Programming」カテゴリーアーカイブ

プログラミング全般に関するカテゴリーです。

python.exeとpythonw.exe

python.exe

  • .py拡張子のファイルで使われる(デフォルト)
  • GUIアプリケーションでもコマンドプロンプトが表示される

pythonw.exe

  • .pyw拡張子のファイルで使われる(デフォルト)
  • コマンドプロンプトは表示されない

.pyでコマンドプロンプトが表示されないように設定

.pypythonw.exeを使うように設定するにはコマンドプロンプトを管理者権限で実行し次のようにします。(インストーラーを使ってインストールした場合はassocの設定は不要です。)

assoc .py=Python.File
ftype Python.File=C:\Python27\pythonw.exe "%1" %*

元のpython.exeを使う設定に戻すには

ftype Python.File=C:\Python27\python.exe "%1" %*

とします。


C:\Python27はPythonのインストール先に読み替えてください。

WindowsのMessageBox関数

WindowsのMessageBox関数の使い方について(C言語)

メッセージを表示するだけ

MessageBox(NULL, "text", "title", MB_OK);

OK/Cancelのメッセージボックス

int ret = MessageBox(NULL, "text", "title", MB_OK);
if(ret == IDOK){
}
else if(ret == IDCANCEL){
}

YES/NOのメッセージボックス

int ret = MessageBox(NULL, "text", "title", MB_YESNO);
if(ret == IDYES){
}
else if(ret == IDNO){
}

リンク

MessageBox 関数
http://msdn.microsoft.com/ja-jp/library/cc410914.aspx

GLSLの勉強

GLSL関連で内容が充実しているTutorialをまとめてみました。

GLSL Tutorial
http://zach.in.tu-clausthal.de/teaching/cg_literatur/glsl_tutorial/

OpenGL Shading Language @ Lighthouse 3D – GLSL Tutorial
http://www.lighthouse3d.com/opengl/glsl/

Tutorial – Getting Started with the OpenGL Shading Language (GLSL) – joshbeam.com
http://joshbeam.com/articles/getting_started_with_glsl