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


HSPTV!掲示板


未解決 解決 停止 削除要請

2017
0308
★HSP★メモ帳を作ってみました...2解決


★HSP★

リンク

2017/3/8(Wed) 15:50:46|NO.78427

まだ100%完成していませんが
メモ帳を作ってみました(^^

ソースです↓

//拡張子読み込み #include "user32.as" #include "shell32.as" #include "VBScript.as" #define WM_SIZE 0x0005 #define ctype LOWORD(%1) (%1 & $FFFF) #enum IDM_KOUMOKU11 = 1 #enum IDM_KOUMOKU12 #enum IDM_KOUMOKU13 #enum IDM_KOUMOKU14 #enum IDM_KOUMOKU15 #enum IDM_KOUMOKU16 #enum IDM_KOUMOKU17 #enum IDM_KOUMOKU21 #enum IDM_KOUMOKU22 #enum IDM_KOUMOKU23 #enum IDM_KOUMOKU24 #enum IDM_KOUMOKU25 #enum IDM_KOUMOKU26 #enum IDM_KOUMOKU27 #enum IDM_KOUMOKU28 #enum IDM_KOUMOKU29 #enum IDM_KOUMOKU210 #enum IDM_KOUMOKU211 #enum IDM_KOUMOKU31 #enum IDM_KOUMOKU32 #enum IDM_KOUMOKU41 #enum IDM_KOUMOKU51 #enum IDM_KOUMOKU52 //ウィンドウ作成 screen 0,ginfo(20),ginfo(21),0 //ウィンドウの最大化最小化使用を可能 GetWindowLong hwnd, -16 SetWindowLong hwnd, -16, stat | $10000 | $40000 //変数管理 sdim text sdim data, 256 //ウィンドウサイズ変更 width 640,480 *Reset //タイトルバー if textname = "" : textname = "無題" title ""+textname+" - メモ帳" //ウィンドウ削除 clrobj //オブジェクト作成 CreatePopupMenu hMenu.5 = stat AppendMenu hMenu.5, 0, IDM_KOUMOKU51, "ヘルプの表示(&H)" AppendMenu hMenu.5, $800, 0, "" AppendMenu hMenu.5, 0, IDM_KOUMOKU55, "バージョン情報(&A)" CreatePopupMenu hMenu.4 = stat AppendMenu hMenu.4, $8, IDM_KOUMOKU41, "ステータス バー(&S)" CreatePopupMenu hMenu.3 = stat CreatePopupMenu hMenu.2 = stat CreatePopupMenu hMenu.1 = stat AppendMenu hMenu.1, 0, IDM_KOUMOKU11, "新規 (&Ctrl+N)" AppendMenu hMenu.1, 0, IDM_KOUMOKU12, "開く (&Ctrl+O)" AppendMenu hMenu.1, 0, IDM_KOUMOKU13, "上書き保存 (&Ctrl+S)" AppendMenu hMenu.1, 0, IDM_KOUMOKU14, "名前を付けて保存(&A)..." AppendMenu hMenu.1, $800, 0, "" AppendMenu hMenu.1, 0, IDM_KOUMOKU15, "ページ設定(&U)" AppendMenu hMenu.1, 0, IDM_KOUMOKU16, "印刷(&P) (&Ctrl+P)" AppendMenu hMenu.1, $800, 0, "" AppendMenu hMenu.1, 0, IDM_KOUMOKU17, "メモ帳の終了(&X)" CreateMenu hMenu.0 = stat AppendMenu hMenu.0, $10, hMenu.1, "ファイル(&F)" AppendMenu hMenu.0, $10, hMenu.2, "編集(&E)" AppendMenu hMenu.0, $10, hMenu.3, "書式(&O)" AppendMenu hMenu.0, $10, hMenu.4, "表示(&V)" AppendMenu hMenu.0, $10, hMenu.5, "ヘルプ(&H)" SetMenu hwnd, hMenu.0 DrawMenuBar hwnd pos 1,1 : mesbox text,ginfo_winx-1,ginfo_winy-1,5 //コマンド oncmd gosub *command, $111 oncmd *Reset,WM_SIZE onkey gosub *TextKey onexit gosub *Save //メモ帳のメイン画面 *NotepadMainLoop //描画開始 redraw 0 //背景 color 0,128,255 : boxf //描画終了 redraw 1 //時間待ち await 1 goto *NotepadMainLoop *TextKey SaveFlag = 1 return //終了する前にセーブダイアログ *Save if SaveFlag = 1 : MsgBox ""+textname+" への変更内容を保存しますか?",3,"メモ帳" if stat = 6{ dialog "txt",17,"テキスト文章" if stat = 0 : return } if stat = 7 : end if stat = 2 : return end *command if lparam = 0 { wID = LOWORD(wparam) dialog "wID = "+wID if wID = IDM_KOUMOKU11{ goto *Save text = "" goto *Reset } if wID = IDM_KOUMOKU12{ dialog "txt",16,"テキスト文章" if stat = 0 : return text = "" notesel buf noteload refstr repeat noteinfo(0) noteget data, cnt text += ""+data+"\n" loop textname = getpath(refstr, 8) SaveFlag = 0 goto *Reset } if wID = IDM_KOUMOKU13{ notesel buf notesave textname } if wID = IDM_KOUMOKU17{ gosub *Save } if wID = 0 { ShellAbout hwnd, "メモ帳 のバージョン情報#Microsoft Windows", "", 37 } if wID = 22 { exec "https://support.microsoft.com/ja-jp/products/windows?os=windows-10",16 } return } if wID = 21 { if checkmenu { uCheck = $0 : checkmenu = 0 } else { uCheck = $8 : checkmenu = 1 } CheckMenuItem hMenu.4, 21, uCheck return } return

VBScript.asです

;(VBScript.as) #ifdef __HSP30__ #module #uselib "user32.dll" #func MessageBox "MessageBoxA" int, sptr, sptr, int #deffunc MsgBox str prompt, int buttons, str MsgTitle MessageBox hwnd, prompt, MsgTitle, MB_OKCANCEL | buttons return #global #endif
アドバイスなど教えてください!!



この記事に返信する


★HSP★

リンク

2017/3/8(Wed) 15:52:50|NO.78428

バグもあってどうすればいいのか分からないので、
出来れば教えてください!!m(-_-)m



IBS

リンク

2017/3/12(Sun) 12:15:15|NO.78498

どんなバグだかわからない。



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