ToolTip (Отобразить)
CODE:
#define WS_VISIBLE 268435456
#define WS_CHILD 1073741824
#define WS_BORDER 8388608
#define TTF_SUBCLASS 16
#define TTS_BALLOON 64
#define TTM_ADDTOOLA 1028
#define CP_ACP 0
#define TTI_INFO 1
#define TTM_SETTITLEA 1056
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll");
int b0, b1, edit0, edit1;
int tooltip1, tooltip2;
char text_tooltip[99];
int TOOLINFO[11];
createdialog(0);
showdialog(0, "Dialog", 300, 300, 250, 200, 1, 1);
loop()sleep(10);
function getmessage(0, WM_CREATE)
{
b0=CreateWindow(0, "BUTTON", "Кнопка0", WS_VISIBLE | WS_BORDER | WS_CHILD, 20, 20, 80, 25, gethwnd(0), 0, 0, 0);
b1=CreateWindow(0, "BUTTON", "Кнопка1", WS_VISIBLE | WS_BORDER | WS_CHILD, 20, 65, 80, 25, gethwnd(0), 0, 0, 0);
edit0=CreateWindow(0, "EDIT", "Edit0", WS_VISIBLE | WS_BORDER | WS_CHILD, 130, 20, 70, 20, gethwnd(0), 0, 0, 0);
edit1=CreateWindow(0, "EDIT", "Edit1", WS_VISIBLE | WS_BORDER | WS_CHILD, 130, 65, 70, 20, gethwnd(0), 0, 0, 0);
tooltip1=CreateWindow(0, "tooltips_class32", "", TTS_BALLOON, 0, 0, 0, 0, gethwnd(0), 0, 0, 0);
tooltip2=CreateWindow(0, "tooltips_class32", "", 0, 0, 0, 0, 0, gethwnd(0), 0, 0, 0);
initialarray(#TOOLINFO[0], 0);
TOOLINFO[0]=44;
TOOLINFO[1]=TTF_SUBCLASS;
TOOLINFO[9]=address(#text_tooltip[0]);
// tooltip для кнопки0
TOOLINFO[2]=b0; // хендл контрола, у которого будет tooltip
TOOLINFO[6]=80; // размер котрола по X
TOOLINFO[7]=25; // размер контрола по Y
strcpy(#text_tooltip[0], "Кнопка0");
sendmessage(TTM_ADDTOOLA, 0, address(#TOOLINFO[0]), formatiw(tooltip1));
// tooltip для кнопки1
TOOLINFO[2]=b1;
TOOLINFO[6]=80;
TOOLINFO[7]=25;
strcpy(#text_tooltip[0], "Кнопка1");
sendmessage(TTM_ADDTOOLA, 0, address(#TOOLINFO[0]), formatiw(tooltip1));
// tooltip для эдит0
TOOLINFO[2]=edit0;
TOOLINFO[6]=70;
TOOLINFO[7]=20;
strcpy(#text_tooltip[0], "Эдит0");
sendmessage(TTM_ADDTOOLA, 0, address(#TOOLINFO[0]), formatiw(tooltip2));
// tooltip для эдит1
TOOLINFO[2]=edit1;
TOOLINFO[6]=70;
TOOLINFO[7]=20;
strcpy(#text_tooltip[0], "Эдит1");
sendmessage(TTM_ADDTOOLA, 0, address(#TOOLINFO[0]), formatiw(tooltip2));
strcpy(#text_tooltip[0], "Заголовок");
sendmessage(TTM_SETTITLEA, TTI_INFO, address(#text_tooltip[0]), formatiw(tooltip1));
}
#define WS_CHILD 1073741824
#define WS_BORDER 8388608
#define TTF_SUBCLASS 16
#define TTS_BALLOON 64
#define TTM_ADDTOOLA 1028
#define CP_ACP 0
#define TTI_INFO 1
#define TTM_SETTITLEA 1056
external(INT, "CreateWindow", "CreateWindowExA", "User32.dll");
int b0, b1, edit0, edit1;
int tooltip1, tooltip2;
char text_tooltip[99];
int TOOLINFO[11];
createdialog(0);
showdialog(0, "Dialog", 300, 300, 250, 200, 1, 1);
loop()sleep(10);
function getmessage(0, WM_CREATE)
{
b0=CreateWindow(0, "BUTTON", "Кнопка0", WS_VISIBLE | WS_BORDER | WS_CHILD, 20, 20, 80, 25, gethwnd(0), 0, 0, 0);
b1=CreateWindow(0, "BUTTON", "Кнопка1", WS_VISIBLE | WS_BORDER | WS_CHILD, 20, 65, 80, 25, gethwnd(0), 0, 0, 0);
edit0=CreateWindow(0, "EDIT", "Edit0", WS_VISIBLE | WS_BORDER | WS_CHILD, 130, 20, 70, 20, gethwnd(0), 0, 0, 0);
edit1=CreateWindow(0, "EDIT", "Edit1", WS_VISIBLE | WS_BORDER | WS_CHILD, 130, 65, 70, 20, gethwnd(0), 0, 0, 0);
tooltip1=CreateWindow(0, "tooltips_class32", "", TTS_BALLOON, 0, 0, 0, 0, gethwnd(0), 0, 0, 0);
tooltip2=CreateWindow(0, "tooltips_class32", "", 0, 0, 0, 0, 0, gethwnd(0), 0, 0, 0);
initialarray(#TOOLINFO[0], 0);
TOOLINFO[0]=44;
TOOLINFO[1]=TTF_SUBCLASS;
TOOLINFO[9]=address(#text_tooltip[0]);
// tooltip для кнопки0
TOOLINFO[2]=b0; // хендл контрола, у которого будет tooltip
TOOLINFO[6]=80; // размер котрола по X
TOOLINFO[7]=25; // размер контрола по Y
strcpy(#text_tooltip[0], "Кнопка0");
sendmessage(TTM_ADDTOOLA, 0, address(#TOOLINFO[0]), formatiw(tooltip1));
// tooltip для кнопки1
TOOLINFO[2]=b1;
TOOLINFO[6]=80;
TOOLINFO[7]=25;
strcpy(#text_tooltip[0], "Кнопка1");
sendmessage(TTM_ADDTOOLA, 0, address(#TOOLINFO[0]), formatiw(tooltip1));
// tooltip для эдит0
TOOLINFO[2]=edit0;
TOOLINFO[6]=70;
TOOLINFO[7]=20;
strcpy(#text_tooltip[0], "Эдит0");
sendmessage(TTM_ADDTOOLA, 0, address(#TOOLINFO[0]), formatiw(tooltip2));
// tooltip для эдит1
TOOLINFO[2]=edit1;
TOOLINFO[6]=70;
TOOLINFO[7]=20;
strcpy(#text_tooltip[0], "Эдит1");
sendmessage(TTM_ADDTOOLA, 0, address(#TOOLINFO[0]), formatiw(tooltip2));
strcpy(#text_tooltip[0], "Заголовок");
sendmessage(TTM_SETTITLEA, TTI_INFO, address(#text_tooltip[0]), formatiw(tooltip1));
}
Исправил под ansi, что с юникодом не играться.