So thanks
actually i build an object plugin with ams plugin maker
now, i want when user clicked on properties button of object plugin, show a windows that contained object plugin info
so, i write below code in ams plugin maker :
###Object Functions###
function ShowProperties(ObjectPtr, PluginFolder)
ActiveWindow = __Window.GetActiveWindow()
DialogBoxOpen = __Plugin.ModalDialogBoxOpen(ActiveWindow, 300, 200, "CoolFX Object Plugin", "CallBack");
if(DialogBoxOpen == IDOK) then
return true;
end
return false;
end
and for initialize and design Properties windows, i write below code :
###Object Functions###
function CallBack(hWnd, message, wParam, lParam)
if (message == WM_INITDIALOG) then
Parent = __Window.GetParent(hWnd);
Font = __Window.SendMessage(Parent, WM_GETFONT, 0, 0);
WindowEx = __Window.CreateWindowEx(0, "STATIC", "this is label", WS_CHILD+WS_VISIBLE, 10, 10, 280, 20, hWnd, 0);
SendMessage = __Window.SendMessage(WindowEx, WM_SETFONT, Font, 0);
-- image type is .bmp or .png
-- image info to create with api here with this information : x = 10, y = 40, width=280, height=100
WindowEx = __Window.CreateWindowEx(0, "BUTTON", "OK", WS_CHILD+WS_VISIBLE+BS_PUSHBUTTON+BS_NOTIFY, 110, 165, 80, 25, hWnd, IDOK);
SendMessage = __Window.SendMessage(WindowEx, WM_SETFONT, Font, 0);
WindowEx = __Window.CreateWindowEx(0, "BUTTON", "Help", WS_CHILD+WS_VISIBLE+BS_PUSHBUTTON+BS_NOTIFY, 210, 165, 80, 25, hWnd, IDHELP);
SendMessage = __Window.SendMessage(WindowEx, WM_SETFONT, Font, 0);
return true;
end
if(message == WM_CLOSE) then
Close = __Plugin.ModalDialogBoxClose(hWnd, IDCANCEL);
return true;
end
if (message == WM_COMMAND) then
local LoWord = __Memory.LoWord(wParam);
local HiWord = __Memory.HiWord(wParam);
if (HiWord == BN_CLICKED) then
if (LoWord == IDOK) then
Close = __Plugin.ModalDialogBoxClose(hWnd, IDOK);
return true;
end
end
end
return false;
end
now, even though that i can create image with ams plugin maker whit below code :
###Object Functions###
-- get properties windows dc
WindowDC = __Window.GetWindowDC(hWnd);
-- create canvas from properties windows dc
Canvas = __Graphics.CanvasFromHdc(WindowDC);
-- extract my image from resource to buffer
LogoBuffer = __Plugin.ResourceExtractToBuffer(1);
-- load image binary
LogoBinary = __Graphics.ImageLoadBinary(LogoBuffer);
-- draw image on properties windows
DrawImage = __Graphics.CanvasDrawImage(Canvas, LogoBinary, 10, 40, 280, 100);
and if possible :
1) i strongly insist to draw my image with api !!
2) how to change STATIC font ??
3) how can write code that when user clicked on "Help" button of properties window, open file like "help.chm" or "help.htm" ??
can you help me, with put a example with ams plugin maker ?
respect you