001 /*
002 * To change this template, choose Tools | Templates
003 * and open the template in the editor.
004 */
005
006 package org.bridj.cpp.mfc;
007
008 import org.bridj.Pointer;
009
010 import static org.bridj.cpp.mfc.OnMessage.Type.*;
011 import static org.bridj.cpp.mfc.StandardAfxCommands.*;
012
013 /**
014 *
015 * @author Olivier
016 */
017 public class TestMFC {
018 public static void main(String[] args) {
019
020 CWnd wnd = new CWnd() {
021 @OnMessage(WM_KEYDOWN)
022 //@AfxMsg(WM_KEYDOWN)
023 public void OnKeyDown(int a, int b, int c) {
024
025 }
026 @OnCommand(ID_FILE_NEW)
027 //@AfxCommand
028 public void OnSomething() {
029
030 }
031
032 @OnCommandEx({ID_FILE_SAVE, ID_FILE_PRINT})
033 public boolean OnSomethingEx(int id) {
034 return true;
035 }
036
037 @OnUpdateCommand(ID_FILE_NEW)
038 //@AfxCommandUpdate
039 public void OnUpdateSomething(Pointer<CCmdUI> pCmdUI) {
040 if (pCmdUI == null)
041 return;
042
043 pCmdUI.get().Enable(true);
044 }
045
046 @OnRegisteredMessage("MYAPP_MYMESSAGE")
047 //@OnRegisteredMessage("MYAPP_MYMESSAGE") // RegisterWindowMessage
048 public void OnMyMessage(int a, int b, int c) {
049
050 }
051 };
052 }
053 }