Some of you surely know the Skinning program Windowblinds3. One can argue about whether this type of Desktop-Skinning is ingenious or not, but every PB-programmers should be able to create programs, that are completly usable on PCs with installed Windowblinds3.
You will encounter some errors with handling events on PB-Exes with installed Windowblinds3 - mouse-clicks on CLOSE Button are not detected and sometimes the #WM_PAINT event is dropped.
Well, there is a small workaround to handle the Close-Buttons of windows: You must handle the #WM_CLOSE event in your callback-procedure and send a global variable to your mainloop.
Example (only the necessary parts - not fully functional):
Code: Select all
Global Terminateflag
Procedure WndProc(WindowID, Message, wParam, lParam)
if Message = #WM_CLOSE
Terminateflag = #TRUE ; WM_CLOSE detected - Set Flag to TRUE
Endif
EndProcedure
mainloop:
Repeat
Event.l = WaitWindowEvent()
...blablabla...
Until Terminateflag = #TRUE
Result.l = MessageRequester("Exit", "Are you shure?,#PB_MessageRequester_YesNo)
If Result.l = #IDYES
Gosub Cleanup ; Last one has to close the doors
END ; End the program
Else
Terminateflag = #FLASE ; Reset Terminateflag ...
Endif
Goto mainloop ; ... and jump back to the mainloop
Registered PureBasic Coder
Edited by - FAKEFACTORY on 20 February 2002 01:05:12