Hi
I am using a java front end to communicate with a Visio drawing
application.I am trying to disable the X button of the controlbox on visio application. I am using jni to accomplish that. I am to disable X button on main application window. However when I open another window(e.g. new drawing) - the child window initially opens with X not disabled. Only when I manually click on the restore button then the button seems to be disable. I call my C dll in java from windowOpened event of visio. My question is what should I do to disable the X button soon after the child window is opened? Here is the code I am using
LONG CurrentStyle;
HWND ahnd;
LONG X;
JNIEXPORT void JNICALL
Java_com_webnettrak_client_util_WindowsApi_RemoveC
loseFromWindow
(JNIEnv *env, jclass obj, jint hwnd)
{
// get parent window from child window handle
ahnd = GetParent((HWND)hwnd);
CurrentStyle = GetWindowLongW(ahnd, GWL_STYLE);
CurrentStyle = CurrentStyle &(~WS_SYSMENU);
X = SetWindowLongW(ahnd, GWL_STYLE, CurrentStyle) ;
SetWindowPos(ahnd,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_
NOSIZE);
}
Thanks in advance
Dhiresh
I am using a java front end to communicate with a Visio drawing
application.I am trying to disable the X button of the controlbox on visio application. I am using jni to accomplish that. I am to disable X button on main application window. However when I open another window(e.g. new drawing) - the child window initially opens with X not disabled. Only when I manually click on the restore button then the button seems to be disable. I call my C dll in java from windowOpened event of visio. My question is what should I do to disable the X button soon after the child window is opened? Here is the code I am using
LONG CurrentStyle;
HWND ahnd;
LONG X;
JNIEXPORT void JNICALL
Java_com_webnettrak_client_util_WindowsApi_RemoveC
loseFromWindow
(JNIEnv *env, jclass obj, jint hwnd)
{
// get parent window from child window handle
ahnd = GetParent((HWND)hwnd);
CurrentStyle = GetWindowLongW(ahnd, GWL_STYLE);
CurrentStyle = CurrentStyle &(~WS_SYSMENU);
X = SetWindowLongW(ahnd, GWL_STYLE, CurrentStyle) ;
SetWindowPos(ahnd,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_
NOSIZE);
}
Thanks in advance
Dhiresh