関連ページ  
Visual Studio VC++ バッチビルドセット




Console 用( vc_build )
ブラウザでダウンロード

Windows 用( vc8_build_win )

ブラウザでダウンロード
Windows (+lightbox.lib) 用
( vc8_build_win_lightbox )

ブラウザでダウンロード


※ Console用の内容です。Windows用には、こちらが入っています。


findwindow.cpp
01.#include <stdio.h>
02.#include <tchar.h>
03.#include <windows.h>
04. 
05.static TCHAR title[512];
06.static TCHAR class_name[512];
07. 
08.int _tmain(int argc, _TCHAR* argv[])
09.{
10. 
11.    title[0] = 0x00;
12.    class_name[0] = 0x00;
13.    HWND hWnd;
14. 
15.    if ( argc == 1 || argc > 3 ) {
16.        printf("%s\n", "findwindow.exe ウインドウタイトル [クラス名]" );
17.        exit( 1 );
18.    }
19.    if ( argc == 2 ) {
20.        lstrcpy( title, argv[1] );
21.        hWnd = FindWindow( NULL, title );
22.    }
23.    if ( argc == 3 ) {
24.        lstrcpy( title, argv[1] );
25.        lstrcpy( class_name, argv[2] );
26.        hWnd = FindWindow( class_name, title );
27.    }
28. 
29.    printf("%u\n", hWnd );
30. 
31.    return 0;
32.}

movewindow.cpp
01.#include <stdio.h>
02.#include <tchar.h>
03.#include <windows.h>
04. 
05.int _tmain(int argc, _TCHAR* argv[])
06.{
07. 
08.    HWND hWnd;
09.    int x,y;
10. 
11.    if ( argc == 1 ) {
12.        printf("%s\n", "movewindow.exe ウインドウハンドル [X Y]" );
13.        exit( 1 );
14.    }
15. 
16.    hWnd = (HWND)(_wtol( argv[1] ));
17. 
18.    RECT drt;
19.    RECT rt;
20. 
21.    if ( argc == 2 ) {
22.        GetWindowRect( GetDesktopWindow(), &drt );
23.        GetWindowRect( hWnd, &rt );
24.        x = ( (drt.right - drt.left) - (rt.right - rt.left) ) / 2;
25.        y = ( (drt.bottom - drt.top) - (rt.bottom - rt.top) ) / 2;
26.        MoveWindow( hWnd, x, y, rt.right - rt.left , rt.bottom- rt.top, true );
27.    }
28.    else {
29.        x = _wtol( argv[2] );
30.        y = _wtol( argv[3] );
31.        GetWindowRect( hWnd, &rt );
32.        MoveWindow( hWnd, x, y, rt.right - rt.left , rt.bottom- rt.top, true );
33.    }
34. 
35.    SetForegroundWindow( hWnd );
36. 
37.    return 0;
38.}
↓readme.txt
【実行方法】

__buildPath.txt に VC++ 用の正しいパスを書いて下さい。
( デフォルトで動作すると思いますが、必要な場合は変更して下さい )

対話ビルド用コマンドライン( VC_BUILD.wsf )でコマンドプロンプトを
表示し、copy_buildline2.wsf を実行すると、クリップボードにコマン
ドラインがコピーされるので対話ビルド用コマンドラインに貼り付けて
実行して下さい。


************************************************************
* 定義ファイル
************************************************************
■ __buildPath.txt( SDK の場所 )

	sdk のパスを設定する

■ __includePath.txt

	ビルドに必要な include があるディレクトリのパスを設定する

■ __libPath.txt

	ビルドに必要な lib があるディレクトリのパスを設定する

■ __clipCommand.txt( クリップボードコピー用コマンド )

	copy_buildline2.wsf によって、この内容が	クリップボード
	にコピーされます


************************************************************
* ソースコード
************************************************************
■ findwindow.cpp と movewindow.cpp


************************************************************
* 実行ファイル
************************************************************
■ findwindow.exe と movewindow.exe
   filerun.bat ( 実際に利用する為のパッチファイル )
   filerun.vbs ( バッチファイル実行時にコマンドプロンプトなし )


************************************************************
* ビルド、その他実行用
************************************************************
■ VC_BUILD.wsf( 対話ビルド用コマンドライン )

	開発中のビルドコマンドを入力する為のコマンドプロンプトを開く
	※ copy_buildline2.wsf を実行して、コマンドラインをクリップ
	   ボートにコピー
	※ 貼り付けて実行

■ copy_buildline2.wsf( クリップボードにコピーします )

	1行でビルドするコマンドラインをコピー


■ copy_buildline.wsf( クリップボードにコピーします )

	2行でビルドするコマンドラインをコピー
	( cl.exe と link.exe の実行を分けています )

************************************************************
* その他
************************************************************
■ readme.txt	このファイル


■ 著作権その他

このプログラムはフリーです。どうぞ自由に御使用ください。
著作権は作者である私( lightbox )が保有しています。
また、本ソフトを運用した結果については、作者は一切責任を
負えせんのでご了承ください。

lightbox