On 5/1/12 22:51, "FrenKy" <
kfr...@gmail.com> wrote:
>
>I want to do following:
> WinDef.HINSTANCE status = Shell32.INSTANCE.ShellExecute(new
>WinDef.HWND(), "open", "c:\\test.txt", "", null, 1);
> int SE_ERR_NOASSOC=31;
> if ( (int) staus == SE_ERR_NOASSOC) <<===Problem
> status = Shell32.INSTANCE.ShellExecute(new WinDef.HWND(),
>"openas", "c:\\test.txt", "", null, 1);
>
>MSDN
>(
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762153%28v=vs.8
>5%29.aspx) stays following:
>Return valueType: HINSTANCE
>If the function succeeds, it returns a value greater than 32. If the
>function fails, it returns an error value that indicates the cause of
>the failure. The return value is cast as an HINSTANCE for backward
>compatibility with 16-bit Windows applications. It is not a true
>HINSTANCE, however. It can be cast only to an int and compared to either
>32 or the following error codes below.
>But for the love of me I can't figure out how to do this comparison...
>Anyone has any idea?
>
>
Wild guess after googling for WinDef.HINSTANCE:
HINSTANCE is a HANDLE is a PointerType so you can
getPointer() on it and pass that to the Pointer class static
nativeValue() method? Maybe that returns the int value of
the HINSTANCE...
br Kusti