Re: Machile level exception

new topic     » goto parent     » topic index » view thread      » older message » newer message

I just tried this:

include win32lib.ew 
 
constant Window1=create(Window,"test",0,100,100,50,50,0), 
         w=create(Window,"aaa",0,10,10,10,10,0) 
 
procedure check(integer self, integer event, sequence params) 
     if params[1]=116 then--f5  
        showWindow(Window1,SW_HIDE)  
     elsif params[1]=117 then--f6  
        showWindow(Window1,SW_SHOWMAXIMIZED)  
     end if  
end procedure  
setHandler(Screen,w32HKeyDown,routine_id("check")) 
openWindow(w,0) 
 
WinMain(Window1,Normal) 

Program behaves as expected. If you remove or hide w, then, when you hit F5, your app has no visible window, so cannot have focus, so win32lib never knows about F6. Screen refers to all windows of current application, not the whole screen like single task OSes might see it. Hooking int 09 like TSRs used to do just doesn't work. The name is quite misleading, but changing it would break between 95 and 99% of existing code base.

If you want to have a single window which you can hide and show from any application, I think the simplest route is to wrap RegisterHotKey() (see http://msdn.microsoft.com/en-us/library/ms646309.aspx ) and process the WM_HOTKEY message using a raw message handler.

Note that there is a registerHotKey() in win32lib, but it does something which is only mildly related. Another name we are stuck with.

CChris Btw I don't have the quirks you mention on XP Pro. Are you using Win98? There might be bugs in that OS.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu