![]() |
PostKeyEx32 an bestimmten Prozess senden...
huhu liebe DP'ler
ich habe hier ne frage zu der PostKeyEx32-prozedur in der form wie ich sie gefunden habe, sendet sie die tastendrücke nur an das aktive fenster ich möchte die tastendrücke aber ein bestimmtes fenster bzw. einen bestimmten prozess senden könnt ihr mir helfen? gruß schparkie p.s. so sieht mein code aus, mit dem ich die prozedur aufrufe:
Delphi-Quellcode:
PostKeyEx32(VK_F1, [], False);
application.ProcessMessages; |
Re: PostKeyEx32 an bestimmten Prozess senden...
*push*
nu hilf mir doch einer bei dem problem :( |
Re: PostKeyEx32 an bestimmten Prozess senden...
#1 -- sorry, hab mich verschaut
#2 Wie schaut die PostKeyEx32 Routine denn genau aus? |
Re: PostKeyEx32 an bestimmten Prozess senden...
Zitat:
|
Re: PostKeyEx32 an bestimmten Prozess senden...
Ohh 18.07.2009 :oops:
Sorry, danke NamenLozer :D MfG |
Re: PostKeyEx32 an bestimmten Prozess senden...
Zitat:
Procedure PostKeyEx32 * * Parameters: * key : virtual keycode of the key to send. For printable * keys this is simply the ANSI code (Ord(character)). * shift : state of the modifier keys. This is a set, so you * can set several of these keys (shift, control, alt, * mouse buttons) in tandem. The TShiftState type is * declared in the Classes Unit. * specialkey: normally this should be False. Set it to True to * specify a key on the numeric keypad, for example. * Description: * Uses keybd_event to manufacture a series of key events matching * the passed parameters. The events go to the control with focus. * Note that for characters key is always the upper-case version of * the character. Sending without any modifier keys will result in * a lower-case character, sending it with [ssShift] will result * in an upper-case character! Hier ist ein Beispiel: ![]() |
Re: PostKeyEx32 an bestimmten Prozess senden...
aaaaaaaaaalso:
1. das von hathor hilft mir in keinster art und weise 2. der push war nicht innerhalb von 24h 3. hier meine PostKeyEx32-Routine:
Delphi-Quellcode:
wie ich die routine aufrufe steht ja im 1. post ganz oben
procedure PostKeyEx32(key: Word; const shift: TShiftState; specialkey: Boolean);
type TShiftKeyInfo = record shift: Byte; vkey: Byte; end; byteset = set of 0..7; const shiftkeys: array [1..3] of TShiftKeyInfo = ((shift: Ord(ssCtrl); vkey: VK_CONTROL),(shift: Ord(ssShift); vkey: VK_SHIFT),(shift: Ord(ssAlt); vkey: VK_MENU)); var flag: DWORD; bShift: ByteSet absolute shift; i:Integer; begin for i := 1 to 3 do begin if shiftkeys[i].shift in bShift then keybd_event(shiftkeys[i].vkey, MapVirtualKey(shiftkeys[i].vkey, 0), 0, 0); end; if specialkey then flag := KEYEVENTF_EXTENDEDKEY else flag := 0; keybd_event(key, MapvirtualKey(key, 0), flag, 0); flag := flag or KEYEVENTF_KEYUP; keybd_event(key, MapvirtualKey(key, 0), flag, 0); for i := 3 downto 1 do begin if shiftkeys[i].shift in bShift then keybd_event(shiftkeys[i].vkey, MapVirtualKey(shiftkeys[i].vkey, 0),KEYEVENTF_KEYUP, 0); end; end; |
Re: PostKeyEx32 an bestimmten Prozess senden...
muss ich schon wieder pushen? :(
|
Re: PostKeyEx32 an bestimmten Prozess senden...
Mit diesem PostKey ist das nicht möglich. Da musste wohl nochmal Googeln :gruebel:
Zitat:
EDIT: Gug mal hier: ![]() |
Re: PostKeyEx32 an bestimmten Prozess senden...
1. das war ja noch kein richtiger push :P sondern nur ne vorwarnung dass ich nochmal pushen werde xD
2. is das auch egal denn dein link is perfekt :) weiss nich wieso ich das nich gefunden habe :gruebel: , weil ich selber recht lange gegoogelt habe :wall: naja, herzlichen dank jedenfalls für deine hilfe gruß schparkie p.s. ich denke, kann geclosed werden |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:41 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz