English
Source / code snippets

inquire Cursor Richedit - 3

 

Source watts on the 15.07.2007 from the MMJ-Quellcodesammlung (Dietmar horn) in The Babyklappe on XProfan.Com stored:
RichEdit: Cursor inquire
Stefan quick
-Begin----------------------------------------------------------- ------
-Header-Files------------------------------------------------------
 $H windows.ph
 $H RichEdit.ph
 $H Structs.ph
 $H Messages.ph
-Structures----------------------------------------------------------
Declare CharRange#
Struct CharRange = ~CHARRANGE
Dim CharRange#, CharRange
-Globale variables---------------------------------------------------
Declare Ende&, hButton&, hWin&, hRtf&
-function GetCursorPosX (slot)-------------------------------------

Proc GetCursorPosX

    SendMessage(hRtf&, ~EM_EXGETSEL, 0, CharRange#)
    Return Int(CharRange#.cpMax& - (SendMessage(hRtf&,
    ~EM_LINEINDEX, SendMessage(hRtf&, ~EM_EXLINEFROMCHAR, 0,
    CharRange#.cpMin&), 0)) + 1)

ENDPROC

-function GetCursorPosY (row)--------------------------------------

Proc GetCursorPosY

    SendMessage(hRtf&, ~EM_EXGETSEL, 0, CharRange#)
    Return Int(SendMessage(hRtf&, ~EM_EXLINEFROMCHAR, 0,
    CharRange#.cpMin&) + 1)

ENDPROC

-Main----------------------------------------------------------------
-GUI---------------------------------------------------------------
hWin& = @Create(Window, %hWnd, Test, 100, 100, 320, 270)

If hWin&

    hRtf& = @Create(RichEdit, hWin&, no Text, 5, 5, 300, 200)
    hButton& = @Create(Button, hWin&, Cursor-position detect,
    5, 210, 300, 24)

EndIf

-Ereignisschleife--------------------------------------------------
Clear Ende&

Repeat

    WaitInput

    If %Key = 2

        Ende& = 1

    ElseIf @Clicked(hButton&)

        @MessageBox(row:  + @Str $(GetCursorPosY()) + @Chr$(13) +
        @Chr$(10) + slot:  + @Str $(GetCursorPosX()),
        XY-position, ~MB_OK)

    EndIf

Until Ende&

Dispose CharRange#
-End-------------------------------------------------------------------
End
 
07/16/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

3.716 Views

Untitledvor 0 min.
Rockford08/01/24
RudiB.09/10/22
Andre Rohland09/05/18
Uwe Lang06/30/18
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie