in reply to Get hInstance handle in XS application?
Try the GetModuleHandle() function. Passing NULL as the parameter will get the handle to the file used to create the current process, eg.
HINSTANCE hInstance = GetModuleHandle(NULL); [download]