HSPポータル
サイトマップ お問い合わせ


HSPTV!掲示板


未解決 解決 停止 削除要請

2009
0426
ww302jpウィンドウ無効化/システムサウンド再生/システムアイコン表示の組み合わせができない4解決


ww302jp

リンク

2009/4/26(Sun) 21:25:21|NO.24848

外部の命令(API?)を使って、
ウィンドウ無効化(ID:0)・システムサウンド再生・システムアイコン表示を行いたいのですが、
以下のスクリプトではエラーが出て実行できません。
ウィンドウ無効化・システムサウンド再生の組み合わせなら実行できたので、
恐らくシステムアイコン表示になんらかの問題があると思うのですが、
如何せん外部の命令を使ってプログラムするのは初めてなもので、
どのような物かあまり理解していません。。
教えて頂けますでしょうか?

#include "user32.as"
#cfunc LoadIcon "LoadIconA" int, int #func DrawIconEx "DrawIconEx" int,int,int,int,int,int,int,int,int screen 0,640,480,0 hWindow = hwnd screen 1,300,200,0 EnableWindow hWindow, value MessageBeep $40 DrawIconEx hdc, rnd(600), rnd(400), LoadIcon(,32516), 32, 32, , , 3:redraw



この記事に返信する


inovia

リンク

2009/4/26(Sun) 21:57:35|NO.24852

これでOKなはず。


#include "user32.as" screen 0,640,480,0 hWindow = hwnd screen 1,300,200,0 EnableWindow hWindow, value MessageBeep $40 LoadIcon 0,32516 DrawIconEx hdc,rnd(600),rnd(400),stat,32,32,0,0,3 redraw



ww302jp

リンク

2009/4/26(Sun) 23:19:16|NO.24858

>inoviaさん
ありがとうございます。確かにできますね。
何がいけなかったのでしょうか?



inovia

リンク

2009/4/26(Sun) 23:51:36|NO.24860

"user32.as"内にも"LoadIcon"が命令としてすでに登録されている為、
"#cfunc LoadIcon "LoadIconA" int, int"でエラーになってしまったわけです。
同じ名前は2度使えないので以下のようにしておけば問題はありません。

#cfunc _LoadIcon "LoadIconA" int, int



たこ

リンク

2009/4/26(Sun) 23:57:25|NO.24861

ヒント

#uselib "user32.dll" #cfunc LoadIcon "LoadIconA" int, int #func DrawIconEx "DrawIconEx" int,int,int,int,int,int,int,int,int #func MessageBeep "MessageBeep" int #func EnableWindow "EnableWindow" int, int



ONION software Copyright 1997-2023(c) All rights reserved.