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. 04
    Jun 2023
    08:11

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

    Category컴퓨터잡담 Views51593
    Read More
  2. 21
    Sep 2013
    15:58

    VBS) FTP.scriptlet and Shell.scriptlet

    CategoryWindowsTip Views48506
    Read More
  3. 07
    May 2023
    04:17

    python AttributeError: 'WebDriver' object has no attribute 'find_element_by_css_selector' 해결방법

    Category파이썬 Views47533
    Read More
  4. 21
    Nov 2012
    18:31

    AHK) 보안프로그램 등으로 화면복사(Printscreen) 안될때 사용방법

    CategoryAutoHotKey Views47165
    Read More
  5. 13
    Feb 2011
    21:48

    pinomate.exe 프로세스 삭제방법

    Category프로세스 Views45999
    Read More
  6. 21
    Sep 2013
    16:04

    VBS) PostMessage or SendMessage to external program

    CategoryWindowsTip Views45965
    Read More
  7. 11
    Aug 2009
    10:07

    [PHP] 원격지의 이미지 사이즈 구하는 방법

    Category컴퓨터잡담 Views44528
    Read More
  8. 06
    Jan 2013
    16:38

    Ahk) 웹페이지 감시결과에 따라 마이피플로 글 전송하기

    CategoryAutoHotKey Views44023
    Read More
  9. 23
    Sep 2023
    22:25

    2023-09-23 서버다운 후 복구완료

    Category컴퓨터잡담 Views43722
    Read More
  10. 10
    Nov 2010
    23:14

    emule 서버리스트

    Category컴퓨터잡담 Views43048
    Read More
  11. 05
    Jan 2012
    07:00

    Excel Vba) 셀의 행, 열(column, row) 주소 알아내기 또는 삽입하기 더불어 제어하기

    CategoryExcel Views42974
    Read More
  12. 16
    Mar 2012
    08:06

    Autohotkey) 화면보호기(ScreenSaver) On/Off 방법

    CategoryAutoHotKey Views40675
    Read More
  13. 26
    Mar 2023
    08:12

    구글 스프레드시트에서 셀값이 특정일에서 현재일과 3일 이내의 범위에 들어오면 이메일을 발송하는 방법

    Category[Docs]스프레드시트 Views40511
    Read More
  14. 16
    Jul 2012
    16:25

    GET.CELL 매크로함수 응용

    CategoryExcel Views40175
    Read More
  15. 26
    Apr 2013
    08:35

    안드로이드 동영상 재생시 파란색 물음표 박스만 나올때 조치방법

    Category컴퓨터잡담 Views39285
    Read More
  16. 30
    Mar 2012
    18:41

    URL Encoding 특수문자코드

    Category컴퓨터잡담 Views39071
    Read More
  17. 07
    Dec 2009
    08:44

    mysql 날짜타입에 기본값으로 현재시간넣기

    Category컴퓨터잡담 Views38588
    Read More
  18. 30
    Oct 2013
    17:50

    ahk) 오토핫키 콤보박스 제어하기

    CategoryAutoHotKey Views38180
    Read More
  19. 29
    Mar 2013
    08:22

    네트워크에 있는 다른 시스템과 ip 주소가 충돌합니다.

    CategoryWindowsTip Views38112
    Read More
  20. 26
    Apr 2023
    01:11

    테블릿을 세컨트모니터로???

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

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소