Convert Windows to Services

hi

I create my windows with CreateWindows() and it's work. But now, i have to create a "MSWindows service". Do you now how can I change my source for do that ?

1
2
HWND  hWndMain ;
hWndMain = CreateWindow(pszAutomateClass, pszName, WS_OVERLAPPED | WS_SYSMENU | WS_MINIMIZEBOX | WS_MINIMIZE, x, y, 531, 400, NULL, NULL, hInstance, NULL);


thx
Last edited on
Use the MS tool to convert any app to service (see associated KB)
I wouldn't trust a tool to convert your app to a service. They should developed quite differently.

Typically, the service object will spawn a thread that will contain your execution. It can then inject an exception within the thread when it needs the thread to stop/pause/continue etc. These are not typically thought about when designing an application.

@george135: how about your post the "associated kb". Otherwise your advice is completely useless.
You shouldn't change your app from a window to service just because it doesnt work. First, identify the problem; why doesnt it work? Then ask yourself, why do I need a Windows service?

After all if you are convinced you need a service, read this article on MSDN to learn more about Windows services: http://msdn.microsoft.com/en-us/library/ms685141(VS.85).aspx

Also, I wouldn't suggest using a tool to convert an app into a service.

Berk Celebisoy
Software Developer, Microsoft Corp.
A good link Berk. Thanks for that :)


Everyone knows the Q137890 and srvany, which works fine for years...
Topic archived. No new replies allowed.