Gamestudio Links
Zorro Links
Newest Posts
phantom() not defined in indicators.c
by AndrewAMD. 08/05/26 17:49
Pause button for evaluation shell?
by AndrewAMD. 08/05/26 13:42
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
What are you working on?
by rayp. 07/24/26 22:58
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,764 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19222 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Load file dialog #282751
08/03/09 14:48
08/03/09 14:48
Joined: Mar 2008
Posts: 67
crumply Offline OP
Junior Member
crumply  Offline OP
Junior Member

Joined: Mar 2008
Posts: 67
Hey,

Is there a way I can get the standard windows file dialog to pop up so I can put a file's location into a string then load it?

I really need help with this one.

An alternative would be how to drag a file onto the executable and have it output a file.

Thanks

Ed

Re: Load file dialog [Re: crumply] #282790
08/03/09 19:11
08/03/09 19:11
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Code:
OPENFILENAME ofd;
	char buf[256];
	FillMemory(&ofd,sizeof(ofd),0);
	FillMemory(buf,256,0);
	
	ofd.Flags=OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST|OFN_NOCHANGEDIR;
	ofd.lStructSize=sizeof(ofd);
	ofd.hwndOwner=hWnd;
	ofd.lpstrFilter	="Windows Bitmap\0*.bmp\0Portable Network Graphics\0*.png\0JPEG\0*.jpg\0TARGA\0*.tga\0\0";
	ofd.lpstrInitialDir = _chr(""); //work_dir
	ofd.lpstrFile=buf;
	ofd.nMaxFile=255;	
	ofd.lpstrTitle="Lade eine Bilddatei für den Hintergrund";
	if (GetOpenFileName(&ofd))
	{
		// ofd.lpstrFile == the string of the filename + location
                // use it like: ent_create(ofd.lpstrFile, vector, NULL);
	}
	else
	{
		// when file is not existing or nothing selected
	}




Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<

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

Gamestudio download | 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