:)
jinjiashan
Posts
-
learn how to learn -
learn how to learnDo you think we don't need method to study C/C++, If you have a good way to study, you can catch c, c++, java, masm and many things quickly.
-
learn how to learnHi,all First,I think learning how to learn is important; Then the knowledge of major; When I study knowledge, I use the way of learning and I explore the way of learn; Do you think so?
-
a bother about windows service:) thank you Snakefoot, I finish it;
-
a bother about windows service?????
-
a bother about windows servicewho can help me?
-
a bother about windows serviceHi,all I have a windows service program with a service,and I can use "myservice/service" in cmd.exe,it sucess! then,I can see the service in control pane,I also can start up this service; But, this service can't run my code;:confused:why?? the whole code here void yourfunction() { for (int a =0; a<10; a++) ::MessageBoxA(NULL, "ggg", "ghgh" ,MB_OK); } SERVICE_STATUS ServiceStatus = { SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS, SERVICE_STOPPED, SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_PAUSE_CONTINUE | SERVICE_ACCEPT_PAUSE_CONTINUE, 0,0,0,0 }; TCHAR szSvName[]=TEXT("Myservice1"); SERVICE_STATUS_HANDLE hStatus; SC_HANDLE SCMger; void WINAPI ControlHandler(DWORD request); void ServiceMain(int argc, char* argv); void CreateMyService() { SCMger=OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS); CreateService( SCMger, szSvName, szSvName, SERVICE_START, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_IGNORE, TEXT("c:\\myservice1.exe"), NULL, NULL, NULL, NULL, NULL); } int main() { SERVICE_TABLE_ENTRY ServiceTable[2]; ServiceTable[0].lpServiceName = szSvName; ServiceTable[0].lpServiceProc=(LPSERVICE_MAIN_FUNCTION)ServiceMain; ServiceTable[1].lpServiceName = NULL; ServiceTable[1].lpServiceProc= NULL; if(StartServiceCtrlDispatcher(ServiceTable)==0)CreateMyService(); } //this fun also can't be debug,can't run void ServiceMain(int argc, char* argv) { hStatus = RegisterServiceCtrlHandler(szSvName,ControlHandler); ServiceStatus.dwCurrentState = SERVICE_START_PENDING; ServiceStatus.dwControlsAccepted = SERVICE_ACCEPT_SHUTDOWN; SetServiceStatus(hStatus,&ServiceStatus); ServiceStatus.dwWin32ExitCode = NO_ERROR; ServiceStatus.dwCheckPoint = 0; serviceStatus.dwWaitHint = 0; ServiceStatus.dwCurrentState = SERVICE_RUNNING; SetServiceStatus(hStatus,&ServiceStatus); yourfunction(); ServiceStatus.dwCurrentState = SERVICE_STOPPED; SetServiceStatus(hStatus,&ServiceStatus); } //this fun can't be debug,can't run void WINAPI ControlHandler(DWORD request) { switch(request) { case SERVICE_CONTROL_SHUTDOWN: ServiceStatus.dwCurrentState = SERVICE_STOPPED; SetServiceStatus(hStatus,&ServiceStatus); break; } }
-
windows serviceHi, all I want to do a windows service program with vs2008, now, i want to know the steps to create windows service; and i want to know the theory about windows service; other,who can give a example?,hehe
-
timer controlRight key to the class,click "attribute", --->"message"--->"WM_TIMER" ::Settimer()
-
Message Loop...use SetWindowsHookEx Function,it can get the message which passed to the target thread you want to watch
-
How to use CListCtrl to handle messagethank you I try to do it
-
How to use CListCtrl to handle messageHi, all message can't be responsed? how to handle?
-
How to use CListCtrl to handle messagethanks for all friends above; I have a class derived CListCtrl, I tend to use this class to access the item associated with this class. so I should use which message handle? all message can't be responded,why? class CMyList : public CListCtrl
-
How to use CListCtrl to handle messageHow to use CListCtrl to handle message
-
tic tac toeHi,I don't have it,