Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
win api #242744
12/25/08 12:58
12/25/08 12:58
Joined: Jul 2007
Posts: 959
nl
F
flits Offline OP
User
flits  Offline OP
User
F

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

Code:
#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 Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
this works fine
Code:
        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
F
flits Offline OP
User
flits  Offline OP
User
F

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
F
flits Offline OP
User
flits  Offline OP
User
F

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: flits] #242762
12/25/08 15:58
12/25/08 15:58
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
The video device is opened in first frame, and before that hWnd is not valid (I think).

Re: win api [Re: Tobias] #242794
12/25/08 18:27
12/25/08 18:27
Joined: Jul 2007
Posts: 959
nl
F
flits Offline OP
User
flits  Offline OP
User
F

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 Offline
Expert
EvilSOB  Offline
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.
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
F
flits Offline OP
User
flits  Offline OP
User
F

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"

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1