Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ctrl+Alt+Del dialog

Status
Not open for further replies.

Robertus

Programmer
Feb 16, 2001
81
0
0
RO
Can you tell why doesn't this code work???
It compiles with 0 errors and 0 warnings but when it runs it crashes !!! (I have Win98 on my machine)
(I want my app not to be shown in the Ctrl+Alt+Del dialog)

.............
typedef DWORD (*P_REGISTER_SERVICE_PROCESS) (DWORD ,DWORD );
.............

BOOL CxxxDlg::OnInitDialog()
{
................................
HINSTANCE hKernel32 = LoadLibrary("kernel32.dll");
if (hKernel32 != NULL)
{
P_REGISTER_SERVICE_PROCESS pRegisterServiceProcess =(P_REGISTER_SERVICE_PROCESS)GetProcAddress(hKernel32,"RegisterServiceProcess");
if (pRegisterServiceProcess != NULL)
{
pRegisterServiceProcess(GetCurrentProcessId(),1);
}
}
..............
}
 
why are you loading explicitly the kernel library? Ion Filipski
1c.bmp


filipski@excite.com
 
Not sure why this shouldn't work; don't have any Win9x so I can't try it out. Maybe try passing NULL rather than calling GetCurrentProcessId(), it defaults to the current process anyway.

BTW, this function only exists on Win9x... :) Hope that this helped! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top