[Done] 4.61 B1 - MessageBox_ API call does nothing

Windows specific forum
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

[Done] 4.61 B1 - MessageBox_ API call does nothing

Post by Inf0Byt3 »

The following code does nothing when I run it in PB 4.61 B1 on a Windows XP SP3 machine:

Code: Select all

MessageBox_(0,"test","test",0)
Last edited by Inf0Byt3 on Mon Jan 16, 2012 3:03 pm, edited 1 time in total.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
User_Russian
Addict
Addict
Posts: 1597
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: 4.61 B1 - MessageBox_ API call does nothing

Post 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)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: 4.61 B1 - MessageBox_ API call does nothing

Post by Trond »

That's because when XP skins are enabled, you need to do as in the above post. This is a Windows "thing".
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

[Done] Re: 4.61 B1 - MessageBox_ API call does nothing

Post by Inf0Byt3 »

Oh, I see, thanks for clarifying this. I got mislead by this kind of code :oops::

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.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Post Reply