WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
 
Forum
Pages (4) [1] 2 3 4   ( Go to first unread post )

Launching Task Manager from a User Application, shall I launch tskmgr.exe / taskman.exe or use keybd_event API to simulate a Ctrl-Alt-Del key press?

SeaFarer
Quote Post


Extremely Active Member
******

Group: Members
Posts: 1751
Member No.: 1464
Joined: 2-September 05


Hi, wink.gif

Is there a function or an undocumented method of opening Task Manager from a user application? unsure.gif

For example:

You would have a button or menu item that could be selected by mouse click versus having to actually press the Ctr-Alt-Del key combination manually.

Incidentially a search of the board turned up nothing on this topic. rolleyes.gif
PM
Top
samael
Quote Post


Typo-lord
******

Group: Moderators
Posts: 404
Member No.: 5187
Joined: 10-June 07


Why not simply launch "tskmgr.exe", located inside your system directory? huh.gif
PM
Top
SeaFarer
Quote Post


Extremely Active Member
******

Group: Members
Posts: 1751
Member No.: 1464
Joined: 2-September 05


For the reason... that file does not exist on win98se.

Taskman.exe is used, but that is not what I want to do.

Should I rephrase the question? laugh.gif

Perhaps there is a way to simulate a Ctrl-Alt-Del key press?
PM
Top
samael
Quote Post


Typo-lord
******

Group: Moderators
Posts: 404
Member No.: 5187
Joined: 10-June 07


You can try the keybd_event API, but this does not get the job done under NT-based systems for the particular combination [ALT+CTRL+DEL].

Apart from the fact that this combination invokes different stuff (according to your PC configuration) on NT-based systems, even if it was invoking TaskManager on the first place, the code posted below won't work....

Dont know if this works under windows 98 though...

The technique works for other key combinations, such as [ALT+TAB] for instance... rolleyes.gif

CODE
;/////////////////////////////////////////////////////////////////////////////
;// Simulate [ALT+CTRL+DEL] combination
; Won't work on NT based systems ????
;///////////////////////////////////////////////////////////////////////////
invoke keybd_event, VK_CONTROL, 0E01Dh, KEYEVENTF_EXTENDEDKEY, NULL; Simulate CONTROL key Press
invoke keybd_event, VK_MENU , 0E038h, KEYEVENTF_EXTENDEDKEY, NULL; Simulate ALT key Press
invoke keybd_event, VK_DELETE, 0E053h, KEYEVENTF_EXTENDEDKEY, NULL; Simulate DELETE key Press

invoke keybd_event, VK_CONTROL, 0E01Dh, �KEYEVENTF_EXTENDEDKEY OR KEYEVENTF_KEYUP , 0; Simulate CONTROL key release
invoke keybd_event, VK_MENU , 0E038h, �KEYEVENTF_EXTENDEDKEY OR KEYEVENTF_KEYUP , 0; Simulate ALT key release
invoke keybd_event, VK_DELETE, 0E053h,KEYEVENTF_EXTENDEDKEY OR KEYEVENTF_KEYUP , 0; Simulate DELETE key release



;/////////////////////////////////////////////////////////////////////////////
;// Simulate [ALT+TAB] combination
; Works OK ???
;///////////////////////////////////////////////////////////////////////////

invoke keybd_event, VK_MENU , 0E038h, KEYEVENTF_EXTENDEDKEY, NULL; Simulate ALT key Press
invoke keybd_event, VK_TAB, 0Fh, NULL, NULL; Simulate TAB key Press
Invoke Sleep,5000; Show the dialog for 5 seconds
invoke keybd_event, VK_MENU , 0E038h, �KEYEVENTF_EXTENDEDKEY OR KEYEVENTF_KEYUP , 0; Simulate ALT key release
invoke keybd_event, VK_TAB, 0Fh, �KEYEVENTF_KEYUP , 0; Simulate TAB key release
PM
Top
SeaFarer
Quote Post


Extremely Active Member
******

Group: Members
Posts: 1751
Member No.: 1464
Joined: 2-September 05


Thanks Sam.

I was trying Keybd_event, but not with the parameters you chose. Let me try your method and respond within the next day.

At the moment I'm wrapping up the Free Disk Space example I've been building since yesterday. I actually have it working now, minus a good dialog. wink.gif
PM
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (4) [1] 2 3 4  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian