Skip to content
조회 수 45965 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

VBS) PostMessage or SendMessage to external program

 

  vbscript code

  const WM_CUSTOMMSG = 1024

      retval = System.SendMessage(hdl,WM_CUSTOMMSG)  
   or 
      retval = System.PostMessage(hdl,WM_CUSTOMMSG)

 

 

 

 

I wrote a little test program using Visual Studio 2003 in C++ unmanage code (SimpleApp.cpp source supplied below) and tried it against ArcPad to test the SendMessage (test script supplied below too). 
 
// Code fragment 1: SimpleApp.cpp
// (contains a single icon resource IDI_SIMPLEAPP)

#include "stdafx.h"
#include "Resource.h"

const TCHAR szTitle[] = TEXT("SimpleApp");
const TCHAR szWindowClass[] = TEXT("SimpleApp");

LRESULT CALLBACK	WndProc(HWND, UINT, WPARAM, LPARAM);

int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR	lpCmdLine, int nCmdShow)
{
	WNDCLASSEX wcex;
	wcex.cbSize = sizeof(WNDCLASSEX); 
	wcex.style			= CS_HREDRAW | CS_VREDRAW;
	wcex.lpfnWndProc	= (WNDPROC)WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= hInstance;
	wcex.hIcon			= LoadIcon(hInstance, (LPCTSTR)IDI_SIMPLEAPP);
	wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
	wcex.hbrBackground	= (HBRUSH)(COLOR_WINDOW+1);
	wcex.lpszMenuName	= NULL;
	wcex.lpszClassName	= szWindowClass;
	wcex.hIconSm		= LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SIMPLEAPP);
	RegisterClassEx(&wcex);
	HWND hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
	if (!hWnd)
		return FALSE;
	ShowWindow(hWnd, nCmdShow);
	UpdateWindow(hWnd);
	MSG msg;
	while (GetMessage(&msg, NULL, 0, 0)) 
	{
		TranslateMessage(&msg);
		DispatchMessage(&msg);
	}
	return (int) msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	PAINTSTRUCT ps;
	HDC hdc;
	switch (message) 
	{
	case WM_PAINT:
		hdc = BeginPaint(hWnd, &ps);
		EndPaint(hWnd, &ps);
		break;
	case WM_DESTROY:
		PostQuitMessage(0);
		break;
	case 1024:
		MessageBox(hWnd, TEXT("1024 received"), TEXT("debug"), MB_OK);
		break;
	default:
		return DefWindowProc(hWnd, message, wParam, lParam);
	}
	return 0;
}

--------------------------------------------------

REM Code fragment 2: test script

Dim w
w = System.FindWindow("SimpleApp", "SimpleApp")
Call System.SendMessage(w, 1024, 0, 0)

 

 

 

 

로그인 후 댓글쓰기가 가능합니다.

?

  1. 07
    Feb 2011
    08:38

    프로세스

    Category프로세스 Views312174
    Read More
  2. 23
    Jan 2013
    16:16

    윈도우 DLL 오류 해결방법

    CategoryWindowsTip Views192701
    Read More
  3. 10
    Oct 2010
    23:49

    자바스크립트로 전송(submit) 버튼 누르기

    Category컴퓨터잡담 Views103644
    Read More
  4. 24
    Aug 2010
    08:03

    hMailServer - 설치시 주의 핵심사항

    Category컴퓨터잡담 Views103067
    Read More
  5. 30
    Oct 2010
    08:15

    북마크 링크 주소모음

    Category컴퓨터잡담 Views102936
    Read More
  6. 15
    Sep 2023
    14:04

    파이썬에서 인식이 잘되는 OCR 종류

    Category파이썬 Views72651
    Read More
  7. 29
    Sep 2023
    20:32

    파이썬 request, beautifulshop으로 정액정보 받아오기

    Category컴퓨터잡담 Views72255
    Read More
  8. 04
    Oct 2023
    23:33

    파이썬 랜덤으로 문제풀기 #2

    Category파이썬 Views72188
    Read More
  9. 14
    Sep 2023
    22:34

    한우경매낙찰 유튜브 영상의 이미지에서 특정 문자 가져와서 저장하기

    Category파이썬 Views71971
    Read More
  10. 17
    Sep 2023
    12:36

    CANON PRINTER ERROR CODE B203, B204 해결방법

    Category컴퓨터잡담 Views71620
    Read More
  11. 04
    Oct 2023
    23:29

    파이썬 랜덤으로 시험문제 풀기

    Category파이썬 Views68365
    Read More
  12. 28
    Jul 2010
    08:39

    엑셀 색깔 지정 함수

    Category컴퓨터잡담 Views65609
    Read More
  13. 21
    Nov 2009
    12:27

    MYSQL 미 해결 과제 : Can't connect to MySQL server on 'localhost'(10055)

    Category컴퓨터잡담 Views64229
    Read More
  14. 17
    Oct 2009
    08:20

    php로 이미지를 mysql디비 저장하고 보여주는 소스

    Category컴퓨터잡담 Views62317
    Read More
  15. 13
    Nov 2023
    05:45

    파이썬 requestsbeautifulsoup 으로 웹 input에 입력값 대입한 뒤 결과값 파일로 저장하기

    Category파이썬 Views60040
    Read More
  16. 22
    Jun 2010
    17:27

    여러개의 엑셀파일을 하나로 합치기

    Category컴퓨터잡담 Views57408
    Read More
  17. 25
    Sep 2010
    16:09

    오류 socket error #10061 connection

    Category컴퓨터잡담 Views54049
    Read More
  18. 12
    May 2012
    17:06

    AHK) AUTOKEY 웹페이지 열지않고 소스 가져오기 또는 로그인 하기

    CategoryAutoHotKey Views52951
    Read More
  19. 21
    Sep 2013
    16:00

    VBS) VBScript Telnet log save

    CategoryVisual C++ Views51929
    Read More
  20. 04
    Jun 2023
    08:11

    H734GP 공유기 시스템로그 중 >>> Send Offer / Receive Discover /

    Category컴퓨터잡담 Views51340
    Read More
Board Pagination Prev 1 2 3 4 5 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소