2 registered members (7th_zorro, dr_panther),
724
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
win api
#242744
12/25/08 12:58
12/25/08 12:58
|
Joined: Jul 2007
Posts: 959 nl
flits
OP
User
|
OP
User
Joined: Jul 2007
Posts: 959
nl
|
i want to set a standard menu so i dont have to create a menu no i have a problme white using api it crash when i add the menu if there is a other way to use api whitout losing control of mouse and key_bord then it will be great
#include <acknex.h>
#include <default.c>
#include <windows.h>
void set_api_main()
{
HMENU menu=CreateMenu();
HMENU hSubMenu=CreateMenu();
InsertMenu(hSubMenu,0,MF_BYPOSITION|MF_STRING,1,"BEEP");
InsertMenu(hSubMenu,1,MF_BYPOSITION|MF_STRING,2,"QUIT");
InsertMenu(menu,0,MF_BYPOSITION|MF_STRING|MF_POPUP,hSubMenu,"File");
//Change Window style to activate Maximize button
SetWindowLong(hWnd,GWL_STYLE, WS_CAPTION+WS_SYSMENU+WS_MAXIMIZEBOX+WS_SIZEBOX);
SetMenu(hWnd,menu);//here it crash
ShowWindow(hWnd,SW_SHOW);
}
function MyMessageFunction(UINT message, WPARAM wParam, LPARAM lParam);
function main()
{
set_api_main();
on_scanmessage = MyMessageFunction;
}
function MyMessageFunction(UINT message, WPARAM wParam, LPARAM lParam){
if(message == WM_COMMAND){ wait(1);}
}
thx flits
"empty"
|
|
|
Re: win api
[Re: flits]
#242751
12/25/08 14:09
12/25/08 14:09
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
this works fine
long menu;
long hSubMenu;
HWND hwnd=hWnd;
menu=CreateMenu();
hSubMenu=CreateMenu();
InsertMenu(hSubMenu,1,MF_BYPOSITION|MF_STRING,1,"BEEP");
InsertMenu(hSubMenu,2,MF_BYPOSITION|MF_STRING,2,"QUIT");
InsertMenu(menu,0,MF_BYPOSITION|MF_STRING|MF_POPUP,hSubMenu,"Datei");
SetMenu(hwnd,menu);
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: win api
[Re: WretchedSid]
#242758
12/25/08 15:43
12/25/08 15:43
|
Joined: Jul 2007
Posts: 959 nl
flits
OP
User
|
OP
User
Joined: Jul 2007
Posts: 959
nl
|
it still crashes on setMenu
"empty"
|
|
|
Re: win api
[Re: flits]
#242761
12/25/08 15:52
12/25/08 15:52
|
Joined: Jul 2007
Posts: 959 nl
flits
OP
User
|
OP
User
Joined: Jul 2007
Posts: 959
nl
|
l0l you never gonna believe
i just put a wait(1); and it works
"empty"
|
|
|
Re: win api
[Re: Tobias]
#242794
12/25/08 18:27
12/25/08 18:27
|
Joined: Jul 2007
Posts: 959 nl
flits
OP
User
|
OP
User
Joined: Jul 2007
Posts: 959
nl
|
i got a new question if i dont use winapi the mouse shows correctly his place when i use it then it is far from right
"empty"
|
|
|
Re: win api
[Re: flits]
#242853
12/26/08 02:47
12/26/08 02:47
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Be careful, is you function is triggered/executed and the user and a keyboard key pressed, it may stay "jammed" on until they press and release it again. I have had this trouble with many API screen-control functions. My UGLY fix was to put in this line in the code. while(key_any!=0) wait(1); Hpe this is of some help.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: win api
[Re: EvilSOB]
#243556
12/30/08 19:03
12/30/08 19:03
|
Joined: Jul 2007
Posts: 959 nl
flits
OP
User
|
OP
User
Joined: Jul 2007
Posts: 959
nl
|
i know now whats wrong but the fuctions isnt standart include in the widows.h
i need this function void LogicalToPhysicalPoint(HWND hWnd,LPPOINT lpPoint); ore the reverse or the BOOL GetPhysicalCursorPos( LPPOINT lpPoint );
does anyone know how to insert this ore how this precies works
seconds question does some how to create a drag drop menu like in sed en med as toolbars
flits
"empty"
|
|
|
|