Hi,<br><br> Anyone have sample code, documentation or know of a good book that<br>describes how to program hooks from Delphi into other applications?<br><br> Thanks
Hi!<br><br>You send many questions on Win API to this forum.<br>Try to look at win32.hlp which must be in Delphi installation (I have seen it in Delphi1,2,3,4,5 ), You find many interesting and usefull API functions there.As for this question see SetWindowsHookEx in that help file.<br><br>Good luck.<br>Vladimir.
Yes you're absolutely right. It seems that for even the most simple tasks I must use Windows API functions. For example, I'm running an application from Delphi which I Minimize on start up. I don't want to give my user the ability to Maximize the application however, I do want an icon left on the task bar at the bottom of the screen (task tray??) and I do want to see the app. in the task manager listing. Apparently, one of the few ways (although certainly not the simplest) is to use hooks, hence my initial quiry. <br><br> If you happen to know of a more simplistic approach to this problem I would be grateful for your input.<br><br>Thanks.<br><br>Glenn.
Project1.exe contain only Form1( this is empty project), this code hides window but on task bar still have program ico:<br><br>WinExec('Project1.exe',SW_SHOWNORMAL);<br>ShowWindow(FindWindow(nil,'Form1'),SW_HIDE);<br><br>another way is to hide program from task bar( still have in task list)<br><br>WinExec('Project1.exe',SW_SHOWNORMAL);<br>ShowWindow(FindWindow(nil,'Project1'),SW_HIDE);<br><br>
This would work if I was trying to hide a Delphi application however, I'm attempting to hide an external application which I start from within my Delphi program. The program I start runs in a DOS Window.
No problem, we can move window:<br>I use fdisk.exe which run in dos window:<br><br>Wnd : HWND;<br>....................<br>WinExec('fdisk.exe',SW_SHOWNORMAL);<br>repeat<br>Wnd:=FindWindow('tty','fdisk');<br>Application.ProcessMessages;<br>until Wnd<>0;<br>SetWindowPos(Wnd,0,2000,2000,0,0,SWP_NOOWNERZORDER or SWP_NOSIZE);<br>..............................<br><br>Vladimir.<br><br><br>
Code above must contain string( at the end ):<br>EnableWindow(Wnd,false);<br>to disable keyboard and mouse input.<br><br>Or we can use next code:<br><br>WinExec('fdisk.exe',SW_SHOWMINNOACTIVE);<br>repeat<br> Wnd:=FindWindow('tty','fdisk');<br> Application.ProcessMessages;<br>until Wnd<>0;<br>EnableWindow(Wnd,false);<br>
Thanks. I'll give this a shot however, I was under the impression that WinExec was obsolete and that in 32 bit Windows (95,98,NT) you should use ShellExecute or CreateProcess??<br><br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.