Subscribe Bookmark RSS Feed

How to Programmatically Dismiss a Dialog ?

I want to present a modal window that contains a list of buttons that perform tasks. When a user clicks the button, the window should close and the task executed.

Dialog windows in JMP are designed to work with OK and Cancel buttons, but it looks like it ought to be possible to extend the dialog to other buttons. When a button is clicked it generates a call to a function called Dismiss. I have implemented a function with this name and can correctly identify the button that was clicked. However, I need to then close the window, and I don't know how to do this.

The reason that I need a modal dialog (apart from the fact that logically the operation is modal) is that the main application is running with a maximised window - and with MDI if one window is maximised then they all are (with the exception of modal windows).
4 REPLIES
gda

Community Trekker

Joined:

Jun 23, 2011

You could do something like this where you would replace the "print" statements with either your code or "include" statements that point to your code. My opinion would be to use include statements to keep the code cleaner.


------------------------------------------------------------------------------------------------------------------------------


//New window for the dialog
Dialog_test = New Window("Select Product Family",
HlistBox(
Button Box("Action 1", Dialog_test< Button Box("Action 2", Dialog_test< Button Box("Action 3", Dialog_test< Button Box("Action 4", Dialog_test< Button Box("Cancel", Dialog_test< )
);
Regarding your comment about keeping the code clean - you can achieve that by using a function definition for the button scripts.

I appreciate your response - my issue is that I want to be able to define buttons on a modal window. These are generated using the Dialog function as opposed to the New Window function, and have different behaviour because of their modality.
aim

Community Trekker

Joined:

Jun 23, 2011

If you are working under windows, you can try this workaround using WinAPI for dismissing modal dialog window:

- Define a title for the dialog box

- When a button is pressed - find the window by title and send it a WM_CLOSE message.







style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//------------------------------------------------

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">



style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//Check
version/system

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//------------------------------------------------

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">If

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Host
is

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> Windows
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">If

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Num

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Word

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">1

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Trim

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">JMP
Version

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">()

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"."

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> )
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">>=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">8

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 2">           

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">1

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 2">           

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Dialog

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Need JMP
v.8.x or newer!"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 2">           

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Throw

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">()

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
)




style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Dialog

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Will only
work under Windows!"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Throw

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">()

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

 




style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//------------------------------------------------

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//Init

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//------------------------------------------------

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">::

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">dialog_caption

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Test
parameters"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//<--
used to find the dialog window later

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">::

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">WM_CLOSE

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Hex to
Number

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"10"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

 




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

 




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">dll

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Load
DLL

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"User32"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">dll

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'"><<

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
DeclareFunction(




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"FindWindowA"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
Convention( STDCALL )

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
Alias(

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"FindWindow"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Arg

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
UInt32

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"lpClassName"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Arg

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
AnsiString

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"lpCaption"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
Returns(
IntPtr )




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

 




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">dll

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'"><<

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
DeclareFunction(




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"SendMessageA"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
Convention( STDCALL )

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
Alias(

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"SendMessage"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Arg

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
IntPtr

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"hWnd"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Arg

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
UInt32

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Msg"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Arg

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
UInt32

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"wParam"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Arg

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
UIntPtr

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"lParam"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
Returns(
IntPtr )




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

 




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">Dismiss

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Function

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
({btn_name}

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
{Default Local}

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//Check
which button was click and do something

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
_txt

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"The button
<"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">||

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> btn_name

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">||

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"> was
clicked!"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">write

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Repeat

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"\!N"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">5

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">))

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">print

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">_txt)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'">//close
dialog window

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
hWnd

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> dll

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'"><<

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
FindWindow(

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">0

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">::

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">dialog_caption
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
mc

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> dll

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'"><<

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
SendMessage(hWnd

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">WM_CLOSE

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">0

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">0

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">1

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

 




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">result

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">Dialog

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">(

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
Title(

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">::

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">dialog_caption
style="mso-spacerun: yes"> 
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Please set
some values and click any button"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
HList(




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     
LineUp(

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">2

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Set this
value"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> numvar1

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
EditNumber(

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">123

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Set
another value"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> numvar2

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
EditNumber(

style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'">456

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Set text
value"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> txtvar

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">=

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'"> Edit
Text(

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"
style="mso-spacerun: yes">  
test
style="mso-spacerun: yes">  
"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"
"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"
"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Do
something #1"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
Button(

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Try
#1"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Do
something #2"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
Button(

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Try
#2"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-tab-count: 1">     

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Do
something #3"

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
Button(

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Try
#3"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
))




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-spacerun: yes"> 
)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
style="mso-spacerun: yes"> 
Button(

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"OK"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">,

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
Button(

style="FONT-SIZE: 10pt; COLOR: purple; FONT-FAMILY: 'Courier New'">"Cancel"

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

 




style="FONT-SIZE: 10pt; COLOR: #0000dd; FONT-FAMILY: 'Courier New'">show

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
(result)

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">

 




style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">dll

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'"><<

style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Courier New'">
UnloadDLL()

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: 'Courier New'">;



Great idea. Many thanks