Windows 7 looking Buttons

Pages: 12
You have already been told to use ResEdit. That program will write resource.rc file for you using a GUI editor.
I dont want to use Res edit, i want to do it manually, i want to do EVERYTHING manually, no programs that do it for you, or make it easier or whatever.
The best way to learn is TO USE ResEdit and see what that program actually do in resource.rc. Then learn to do it manually.
It will be faster, as no forum posting and waiting for somebody to reply will be required.
well, i did download it but it said that windows.h could not be found? do i need to put it in my project folder? Is therea tutorial somewhere on how to set this up?
Last edited on
What is the problem here ?

That's simple enough : create a file named manifest.xml and put this in it :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="1.0.0.0"
    processorArchitecture="*"
    name="CompanyName.ProductName.YourApplication"
    type="win32"
/>
<description>Your application description here.</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="*"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>

( Copy-Pasted from MSDN : http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx )

Then, create a RC file (if you don't already have one) and to it, add this line :

 
1 24 "manifest.xml"


(The resources compiler must find the XML so complete the path to it if needed)

There is no need to use Microsoft's proprietary tools, and it's fully possible to create good applications using Code::Blocks.
And there is also a possibility to set up Code::Blocks to compile the source code using the Visual C++ compiler without to use visual Studio.
Thats not what I was asking, I was asking how to get the keywords MENU and EDITTEXT to work properly. I cant get a menu to work and edittext only lets me type on one line. I need to know where exactly tbe code for each goes.
Use ES_MULTILINE | ES_WANTRETURN style for the edit control, it is all documented in MSDN.
Use O 6LodaMenu to load and show a menu using DialogBox.
Sorry for typing, i use my mobile phone.
ok cool i got it working. now how do i do the menu? where do i put it? main, resource.rc?
Last edited on
Also how do i save the text in the text field? I know its documented on MSDN but it doesnt give all that much information on some things, and it gives you crappy examples. And im trying to makea folder too that accepts files and shows them in the window. I have this in my resource.rc and i notice when i drag a file over the winodw it shows the cursor like you can drop it in there but it doesnt show up. I want it to show the files like a regular folder you would create.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "resource.h"

DLG_MAIN DIALOGEX 6, 5, 600, 300

CAPTION "Code::Blocks Template Dialog App"

FONT 8, "Tahoma"

STYLE 0x10CE0804
EXSTYLE WS_EX_ACCEPTFILES | WS_VISIBLE | WS_CHILD


BEGIN

END



I know im asking to do alot of different things, but i'm making something, a project manager that will help in the designing and management of medium to large scale projects. I was mainly making it to help my company organize game projects but i'll make it for other projects too like school, work and programming. There is more stuff i need to know to complete my program but i'll just work with this stuff for now and make simple programs with them to get used to the syntax and alol that.

Oh and is there a Tabs resource control? to make tabs like in internet explorer?
Last edited on
Bump
Please help with my above question. Just these 3 things and i can practice. or at least give me links to good tutorials that show how to do everything i want to do.
Process WM_DROPFILES message in your window procedure. i am sure you will find examples on google or msdn.
There is also OLE drag & drop, but it is more complicated than WM_DROPFILES.
Look at propertysheet control to make tabs.
I didnt find much on google, maybe im just using the wrong search terms. But MSDN doesnt have much on it that was useful to me. I sort of did have it working one time, i dragged the files in the folder and the file created a button, but thats not what i want, i want the file to show up exactly as it does on the desktop. The tabs might be a little harder than i thought so i might save those for later. also how do i call the text from the textbox and save it? is there any links on that? tried google and MSDN but there wasnt much info and i kept getting MFC and other weird stuff.
Last edited on
This is a working example, please don't rush to say 'it doesnt work' before you understand what is doing:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
	case WM_DROPFILES:
		{
	
		TCHAR lpszFile[MAX_PATH] = {0};
		UINT uFile = 0;
		HDROP hDrop = (HDROP)wParam;

		uFile = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, NULL);
		if (uFile != 1){
			MessageBox (hDlg, _T("Dropping multiple files is not supported."), NULL, MB_ICONERROR);
			DragFinish(hDrop);
			break;
			}
		lpszFile[0] = '\0';
		if (DragQueryFile(hDrop, 0, lpszFile, MAX_PATH))
			{
				MessageBox (NULL, lpszFile, NULL, MB_ICONINFORMATION);
			}
			
		DragFinish(hDrop);
			break;
		}


To get text from a textbox use GetWindowText().
Last edited on
im sure it does work but I still got errors:

What am i doing wrong?

||=== Folder, Debug ===|
C:\Users\Chay Hawk\Desktop\C++\Folder\main.cpp||In function 'BOOL DialogProc(HWND__*, UINT, WPARAM, LPARAM)':|
C:\Users\Chay Hawk\Desktop\C++\Folder\main.cpp|26|error: 'HDROP' was not declared in this scope|
C:\Users\Chay Hawk\Desktop\C++\Folder\main.cpp|26|error: expected ';' before 'hDrop'|
C:\Users\Chay Hawk\Desktop\C++\Folder\main.cpp|28|error: 'hDrop' was not declared in this scope|
C:\Users\Chay Hawk\Desktop\C++\Folder\main.cpp|28|error: 'DragQueryFile' was not declared in this scope|
C:\Users\Chay Hawk\Desktop\C++\Folder\main.cpp|30|error: 'hDlg' was not declared in this scope|
C:\Users\Chay Hawk\Desktop\C++\Folder\main.cpp|30|error: '_T' was not declared in this scope|
C:\Users\Chay Hawk\Desktop\C++\Folder\main.cpp|31|error: 'DragFinish' was not declared in this scope|
C:\Users\Chay Hawk\Desktop\C++\Folder\main.cpp|40|error: 'DragFinish' was not declared in this scope|
||=== Build finished: 8 errors, 0 warnings ===|
1
2
#include <tchar.h>
#include <Shellapi.h> 


link against shell32.lib (or libshell32.a)

As for hDlg not being defined, replace it with whatever you named first argument of your DialogProc.
How do you link to shell32.lib?

I get an error when i drag a file to the folder, it says "c:\Users\Chay Hawk\Desktop\Floor Plans.png"

I dont know what that means?
Last edited on
Please help. Also is there any "For Dummies" books on Windows API programming? Or anything similar thats super easy to understand. If not is there a site that explains all of the Windows API Syntax in depth? MSDN and CPP.com are not good sources. I'm terribly sick right now or else i would look it up myself. Thanks.
Last edited on
Please help me i really need help, i did try doing stuff myself and looking it up on the internet, but stuff on the internet is sometimes too technical for my odd brain to grasp. forget the folder thing. Can someone tell me if there is a Tabs resource control keywotrd, what it is and give me a link to a site that explains it, or just at least tell me what it is. Also how do i get the text in the text fild and save it? I tried something earlier but, shit got crazy and didnt even work.
Last edited on
please help.
Topic archived. No new replies allowed.
Pages: 12