NTK and The NTK Project
are properties of Jn Dechereux
Home | Documentation | FAQ.

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorTeam NTK
    • CommentTimeOct 9th 2009 edited
     

    Q. I've noticed that some of the Windows constants are not included in Windows.ch. What should I do?
    A. Most of major constants are included, but some rarer or newer ones may not be. You may have to look at the include folder of your Borland CPP (or other C++ tool) to use its supplied .H files. Maybe you can find there the constants you need. If not, try referring to the Microsoft Software Developer Network online documentation. Another good idea is to dig into Wine (the linux open source project), its .H include files are often a mine of precious informations.


    •  
      CommentAuthorTeam NTK
    • CommentTimeOct 9th 2009 edited
     

    Q. I am currently using NTK for conversion of a Dos-Clipper application. May I get 1 sample program which show me how to create a main window with a menubar?
    A. Using NTK, you have many way of making menus. At least, I see 3 differents:



    1) Using the standard Win32/NTKCore way. That is to say: invoking NTK's popup-menu functions. Besides, those functions are complete clones of Clip4win ones. You'll find many samples browsing NTKRad or NTKCore subfolders. Maybe you will also find helpfull, glancing at PRINT.PRG in NTKRad or DEMOMULT.PRG in NTKCore directory.



    2) If you prefer the old Clipper way of coding menus via the @ ... Prompt command:
    Give a try to Abbougaga's contribution called PrompMnu. You'll find it in your \wntk4hrb\contribs\ subfolder or maybe a more recent version in the 'NTK - Knowledge sharing' section:
    http://www.ntkproject.com/forum_ntk/?CategoryID=3



    3) The last technic consist in using NTKRad's button or toolbar commands.
    Basically, each button is supposed to work with at least 2 different bitmaps. One for standard buttonup state, and one (same bmp, but with more highlighted colors) for the buttonmouseover state. Thus, when your final user is dragging the mouse arrow over a button within the toolbar, this last appears to be more intense. Using this technic with the NTK's hyperlink button style, you will get very fancy menubars...



    Find out more about this subject reading the following chapters of NTKRad.pdf book:
    - 0.6 @... Create toolbar
    - 0.8 @... Hyperlink...



    Also, you'll find a good sample of how to use hyperlink buttons in \wntk4hrb\ntkrad\appdemo\main.prg
    Feel free to explore the whole APPDEMO folder and subfolders to really figure out how things work.


    •  
      CommentAuthorTeam NTK
    • CommentTimeOct 9th 2009 edited
     
    Q. Is it possible to create a Windows that always stays on top of the other Windows of my application?
    A. Yes, just add the WS_EX_TOPMOST constant to the extended style parameter of your window.

    e.g.

    If you're using NTKRad syntax,
    CREATE WINDOW hWndMain       ;
           STYLE F_MIN+F_MAX+WS_SYSMENU ;
           EXSTYLE WS_EX_TOPMOST ;  // 'Always on Top' 
           SIZE 640,480          ;  
           TITLE cWinTitle
    


    Or
    with NTKCore APIs,
    hWndMain := NTK_CreateWindowEx( WS_EX_WINDOWEDGE, "MYCLASS", cWinTitle,;
                                 F_MIN+F_MAX+WS_SYSMENU,;
                                 0, 0, 640, 480 )
    
    •  
      CommentAuthorTeam NTK
    • CommentTimeOct 9th 2009 edited
     
    Q. Can I run another program from my current application, and wait until this program achieves its task?
    A. Yes, consider this simple function as an example. Of course, you'll have to adapt it to your own needs:
    FUNCTION ShowReport( hWndMain )
    Local cReport := "C:\MyAPP\tmp\MyReport.txt "
    
    NTK_ShowWindow ( hWndMain , SW_MINIMIZE )
      // --- Display the report preview ( probably using NOTEPAD )
      // --- and wait util user clicks Notepad cancel button ...
      RUN ( cRapport ) AND WAIT
    NTK_ShowWindow ( hWndMain , SW_RESTORE )
    
    RETURN (Nil )
    


    The RUN command allows developer to call almost all kind of external process, as long as it is
    recognized by MS-Windows. RUN is based upon NTK Run() API, which is itself based on the
    NTK ShellExecute() Win32 API.