 |
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
Dragonpearl Grandmaster Cheater Supreme
Reputation: 0
Joined: 17 Sep 2007 Posts: 1240 Location: behind you with a dagger
|
Posted: Fri Jan 04, 2008 9:55 am Post subject: how do I open links in my trainer? |
|
|
When somebody presses a button, how do I make that button go to a place on the web?
Like if I make a command button, and it says CEF, how do I make it so the person who clicks the button could go to CEF?
|
|
Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Fri Jan 04, 2008 10:10 am Post subject: Re: how do I open links in my trainer? |
|
|
Dragonpearl wrote: | When somebody presses a button, how do I make that button go to a place on the web?
Like if I make a command button, and it says CEF, how do I make it so the person who clicks the button could go to CEF? |
Google is your friend, use ShellExecute.
|
|
Back to top |
|
 |
killersamurai Expert Cheater
Reputation: 0
Joined: 10 Sep 2007 Posts: 197 Location: Colorado
|
Posted: Fri Jan 04, 2008 3:03 pm Post subject: |
|
|
CreateProcess() would be a better choice than ShellExecute().
If you want to load it up using the default web browser, you can look in the registry for it.
To use CreateProcess() it would look something like this
Code: |
CreateProcess(<Program path>, L"-url http://forum.cheatengine.org", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
|
si is a STARTUPINFO struct.
pi is a PROCESS_INFORMATION struct.
I've created a little program that would demonstrate how to: Get the default web browser and open it up with the URL. It's done in c++. Also, here is the source if you want to learn (beware, it isn't the most optimized code you'll see).
Code: |
#include <windows.h>
int main()
{
HKEY hKey;
TCHAR cData[MAX_PATH];
DWORD dwDataSize;
DWORD dwType = 0;
LPCTSTR lpSubKey = L"SOFTWARE\\Classes\\HTTP\\shell\\open\\command";
LONG isSuccess = 0;
isSuccess = RegOpenKeyEx(HKEY_LOCAL_MACHINE, lpSubKey, NULL, KEY_QUERY_VALUE, &hKey);
if (isSuccess == ERROR_SUCCESS)
{
isSuccess = RegQueryValueEx(hKey, NULL, NULL, &dwType, (LPBYTE)cData, &dwDataSize);
if (isSuccess == ERROR_SUCCESS)
{
TCHAR* c;
c = (TCHAR*)memchr(cData, '-', dwDataSize);
cData[c - cData] = 0;
bool isThere = true;
do
{
c = (TCHAR*)memchr(cData, '\"', dwDataSize);
if (c == NULL)
{
isThere = false;
}
else
{
cData[c - cData] = 32;
}
} while (isThere);
if (cData[0] == 32)
{
for (DWORD i = 0; i < dwDataSize; i++)
{
if (cData[i] == 0)
{
break;
}
cData[i] = cData[i + 1];
}
}
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
CreateProcess(cData, L"-url http://www.bungie.net", NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}
}
return 0;
}
|
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Jan 04, 2008 6:40 pm Post subject: |
|
|
Thats a bit overkill just to launch a browser.. ShellExecute will automatically do basically what you just did and launch the systems default browser already. No reason not to use ShellExecute.
_________________
- Retired. |
|
Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Sat Jan 05, 2008 10:19 am Post subject: |
|
|
if ur using .NET then you cud just use Process Start
C++
System::Diagnostics::Process::Start("url");
C# & VB
System.Diagnostics.Process.Start("url");
if not, then ShellExecute
_________________
|
|
Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Sat Jan 05, 2008 10:27 am Post subject: |
|
|
Don't use the cheatengine strings. Some GG's detect it. Use variables like:
a := 'http://forum.cheat';
b := 'engine.org';
It works (well as far as I know).
|
|
Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Sat Jan 05, 2008 10:32 am Post subject: |
|
|
He just makes Flash trainers.
|
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|