You are here

Add link in AppMenu

2 posts / 0 new
Last post
CyySky
Offline
Last seen: 17 years 5 months ago
Joined: 2007-04-15 23:59
Add link in AppMenu

Do you have any other folder in X:\Document\?
Now you can open it with single click,by add a exe in list.

This is source code,modify the location you want to open and complie by DEV C++
http://home.kimo.com.tw/chongyoeyat/Open.7z

Done.This is my first workable win32 program. Any question please ask.

CyySky
Offline
Last seen: 17 years 5 months ago
Joined: 2007-04-15 23:59
//Main.cpp win32

//Main.cpp win32 project


#include "windows.h"

int WINAPI WinMain (HINSTANCE hThisInstance,
      	   		    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)
{
	char TempDirectory[255];
 	GetCurrentDirectory(sizeof(TempDirectory),TempDirectory);

        //Type the path you want to link.
 	char FolderDirectory[]="\\documents\\software\\"; 	
        
 	SetCurrentDirectory(FolderDirectory);

	char CurrentDirectory[255];
 	GetCurrentDirectory(sizeof(CurrentDirectory),CurrentDirectory);

	if(strcmp(TempDirectory,CurrentDirectory)!=0)
	{
	 	char Parameter[]="/e,/root,"; //parameter of explorer.exe
		char PD[sizeof(Parameter)+sizeof(CurrentDirectory)];

		strncpy(PD,Parameter,sizeof(PD));
		strncat(PD,CurrentDirectory,sizeof(PD));
	
		ShellExecute(NULL,"open","explorer",PD,NULL,SW_SHOW);
	}
    return 0;
}


Log in or register to post comments