當前位置:編程學習大全網 - 源碼下載 - 如何使用VC++使用大漠插件後,怎麽將數據類型進行

如何使用VC++使用大漠插件後,怎麽將數據類型進行

#include "afxdialogex.h"

#include <windows.h>

#include <iostream>

#include <string>

#include <tchar.h>

#include <comutil.h>

#include <atlconv.h>

#import "C:\test_game\dm.dll" rename("SetWindowText","DmSetWindowText") rename("FindWindow","DmFindWindow") rename("FindWindowEx","DmFindWindowEx") rename("StrStr","DmStrStr")

#import "C:\test_game\WebOperation.dll"

using namespace std;

using namespace Dm;

int h=500,h1=1000,h2=2000;

Idmsoft* dme;

HINSTANCE hDll;

typedef int(*lpScrollTo)(int, int);

typedef int(*lpGethWnd)(_bstr_t, int);

long hwnd1,hwnd2;

HWND hwnd3;

void Scroll(int argc, int arg)

{

HINSTANCE hDll;

lpScrollTo ScrollTo;

//LPCSTR lpStr = (LPCSTR)("C:\test_game\WebOperation.dll");

//char* pszGbt=new char[70];

//(LPWCSTR)("C:\test_game\WebOperation.dll")

hDll = LoadLibrary(LPCWSTR("C:\test_game\WebOperation.dll"));

if (hDll != NULL)

{

ScrollTo = (lpScrollTo)GetProcAddress(hDll,"ScrollTo");

if (ScrollTo != NULL)

{

ScrollTo(argc,arg);

}

FreeLibrary(hDll);

}

}

long GethWnd1(_bstr_t ar, int arg)

{

HINSTANCE hDll;

lpGethWnd GethWnd;

//LPCSTR lpStr = (LPCSTR)("C:\test_game\WebOperation.dll");

//char* pszGbt=new char[70];

//(LPWCSTR)("C:\test_game\WebOperation.dll")

hDll = LoadLibrary(LPCWSTR("C:\test_game\WebOperation.dll"));

if (hDll != NULL)

{

GethWnd = (lpGethWnd)GetProcAddress(hDll,"GethWnd");

if (GethWnd != NULL)

{

return GethWnd(ar,arg);

}

FreeLibrary(hDll);

}

}

void chushihua1()

{

CoInitialize(NULL);

CLSID clsid;

HRESULT hr=CLSIDFromProgID(OLESTR("dm.dmsoft"),&clsid);

hr=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(Idmsoft),(LPVOID*)&dme);

_bstr_t dvr=dme->Ver();

//CString cstr((char *)dvr);

//AfxMessageBox(dvr);

}

void jubing()

{

hwnd1=dme->DmFindWindow((_bstr_t)"",(_bstr_t)"Q將三國_個人中心_起點中文網 - Microsoft Internet Explorer");

hwnd3=::FindWindow((LPCWSTR)NULL,(LPCWSTR)"Q將三國_個人中心_起點中文網 - Microsoft Internet Explorer");

if (hwnd1 != 0)

{

dme->SetWindowState(hwnd1,4);

}

//hwnd2=HWND(dme->DmFindWindowEx(1,"Internet Explorer_Server","Q將三國_個人中心_起點中文網 - Microsoft Internet Explorer"));

hwnd2=GethWnd1((_bstr_t)"/game/game.aspx?appid=510",1);

}

  • 上一篇:1990~2013好看的好萊塢電影有哪些?
  • 下一篇:市面上的主流遊戲引擎有哪些?
  • copyright 2024編程學習大全網