Page 1 of 1
[Done] 4.61 B1 - MessageBox_ API call does nothing
Posted: Mon Jan 16, 2012 1:59 pm
by Inf0Byt3
The following code does nothing when I run it in PB 4.61 B1 on a Windows XP SP3 machine:
Re: 4.61 B1 - MessageBox_ API call does nothing
Posted: Mon Jan 16, 2012 2:09 pm
by User_Russian
Inf0Byt3 wrote:The following code does nothing when I run it in PB 4.61 B1 on a Windows XP SP3 machine
This code works?
Code: Select all
InitCommonControls_()
MessageBox_(0,"test","test",0)
Re: 4.61 B1 - MessageBox_ API call does nothing
Posted: Mon Jan 16, 2012 2:17 pm
by Trond
That's because when XP skins are enabled, you need to do as in the above post. This is a Windows "thing".
[Done] Re: 4.61 B1 - MessageBox_ API call does nothing
Posted: Mon Jan 16, 2012 3:02 pm
by Inf0Byt3
Oh, I see, thanks for clarifying this. I got mislead by this kind of code

:
Code: Select all
If OpenWindow(0, 100, 100, 100, 100, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_CloseWindow ; If the user has pressed on the close button
MessageBox_(0,"test","test",0)
Quit = 1
EndIf
Until Quit = 1
EndIf
End
As you can see, there is no initialization in the above code. But that's because PureBasic calls "InitCommonControls_()" internally for use with the GUI it creates. It's all clear now, thanks.