Key Press to have Window "reappear ??
- Posted by Selgor Feb 22, 2011
- 1701 views
Hello , Selgor here.
The programme is an application strip. The "strip" is set to "invisible" with setVisible(Win,0). I am trying to have the Window Strip "reappear" . Tried "lots" and the only "thing" that works is the for next loop which is not the most favourable. So, I would like to press a key e.g. ESCAPE to have the window strip "reappear". I have left all my "tries" as edited out code. Hope someone can help. Thnx.
Cheers. Selgor.
include win32lib.ew without warning include get.e -- global object endit endit = 0 constant Win = create(Window,"",0,220,150,690,45,{WS_POPUP,WS_DLGFRAME}), Icn1 = create( Icon, "", Win, 5, 5, 32, 32, 0 ), Icn2 = create( Icon, "", Win, 45, 5, 32, 32, 0 ), Icn3 = create( Icon, "", Win, 85, 5, 32, 32, 0 ), Icn4 = create( Icon, "", Win, 125, 5, 32, 32, 0 ), Icn5 = create( Icon, "", Win, 165, 5, 32, 32, 0 ), Icn6 = create( Icon, "", Win, 205, 5, 32, 32, 0 ), Icn7 = create( Icon, "", Win, 245, 5, 32, 32, 0 ), Icn8 = create( Icon, "", Win, 285, 5, 32, 32, 0 ), Icn9 = create( Icon, "", Win, 325, 5, 32, 32, 0 ), Icn10 = create( Icon, "", Win, 365, 5, 32, 32, 0 ) setWindowBackColor(Win,0027110 ) setIcon( Icn1, "c:\\im\\icos\\c.ico" ) setIcon( Icn2, "c:\\im\\icos\\cd.ico" ) setIcon( Icn3, "c:\\im\\icos\\dl.ico" ) setIcon( Icn4, "c:\\im\\icos\\ed.ico" ) setIcon( Icn5, "c:\\im\\icos\\f2p.ico" ) setIcon( Icn6, "c:\\im\\icos\\pif.ico" ) setIcon( Icn7, "c:\\im\\icos\\rm.ico" ) setIcon( Icn8, "c:\\im\\icos\\ts.ico" ) setIcon( Icn9, "c:\\im\\icos\\wfe.ico" ) setIcon( Icn10, "c:\\im\\icos\\wk.ico" ) setHint( Icn1 , "Control Panel" ) setHint( Icn2 , "Check Disk" ) setHint( Icn3 , "Dir Lister" ) setHint( Icn4 , "Erase CD-DVD" ) setHint( Icn5 , "Folder 2 My PC" ) setHint( Icn6 , "PastIconFlusher" ) setHint( Icn7 , "Ram Monitor" ) setHint( Icn8 , "Tree Size" ) setHint( Icn9 , "Fonts on PC" ) setHint( Icn10 , "Win Hot Key" ) --procedure appear() -- setVisible(Win,1) ---end procedure -- integer stopped --stopped = 0 --procedure WinKey(integer self, integer event, sequence parms) -- Check for key presses. -- if parms[1] = VK_ESCAPE then appear() --setVisible(Win,1) end if -- stopped = not stopped -- elsif parms[1] = VK_ENTER then -- init_vars() -- stopped = 0 -- end if --end procedure --setHandler(Win, w32HKeyDown, routine_id("WinKey")) procedure run_it ( integer self, integer event, sequence parms ) -- integer keyCode keyCode = 0 if self = Win then setVisible(Win,0) ------->>>>>>> for i = 1 to 1000000000 do end for ------->>>>>>> setVisible(Win,1) -- if event = keyCode then if keyCode = 27 then setVisible(Win,1) end if -- end if -- closeWindow(Win) closeApp() end if if self = Icn1 then shellExecute ("open","c:\\windows\\system32\\control.exe",SW_SHOWNORMAL) closeWindow(Win) closeApp() end if if self = Icn2 then shellExecute ("open","c:\\checkdisk\\checkDisk.exe",SW_SHOWNORMAL) closeWindow(Win) closeApp() end if if self = Icn3 then shellExecute ("open","C:\\Program Files\\Directory Lister\\DirLister.exe",SW_SHOWNORMAL) closeWindow(Win) closeApp() end if end procedure setHandler({Win,Icn1,Icn2,Icn3}, w32HClick, routine_id("run_it")) -- w32HKeyDown WinMain(Win, Normal)