Results 1 to 13 of 13

Thread: Question for all

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Utah, USA
    Posts
    121

    Arrow

    Ok..I have so many dumb questions that keep popping up..I think I will just ask them all here rather then start a new thread each time.....

    1. How do I copy txtCode.Text to the system clipboard?

    2. How do I pass like subject, etc. arguments to a mail program? I am calling mailto:[email protected] via a shell to launch the default mail program..how do I pass the arguments too?

    more later..

    Thanks
    Zevlag

  2. #2
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    Last edited by chrisjk; Apr 21st, 2001 at 11:03 AM.

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Question One:
    Code:
    'paste into a textbox 
    Text1 = Clipboard.Gettext 
    
    'get text from a textbox 
    Clipboard.Settext Text1.text 
    
    'copy a variable content to clipboard 
    Clipboard.Settext MyVar 
    
    'clear the clipboard 
    Clipboard.Clear
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Utah, USA
    Posts
    121
    Well that kinda works....

    when I do that the text can be pasted somewhere else in the program but let's say I open Notepad and whatever was on the system CLipboard get pasted.....

    It's almost as though it is using it's own clipboard......

    I can use ctrl + c and ctrl + v to do it but i want them to be able to click a command and have it copy to the system clipboard so it can pasted somewhere else...

    Kinda weird

    Zevlag

  5. #5
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923
    The code I and HeSaidJoe gave should copy to the system clipboard and be available to any program that accepts text pasting. After you have copied the text, go to Start->Programs->Accessories->System Tools->Clipboard Viewer and make sure it appears in there.

    Don't forget there is a bug(??) in VB that clears the clipboard whenever you open it. Maybe that is your problem.
    Last edited by chrisjk; Apr 21st, 2001 at 11:13 AM.

  6. #6
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    Of course when you open Notepad you must paste the clipboard using edit paste or shortcuts but this copies
    the text from Text1 and paste it when using edit paste.

    Code:
    Private Sub Command1_Click()
        'clear the clipboard
        Clipboard.Clear
        'get text from a textbox
        Clipboard.SetText Text1.Text
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Utah, USA
    Posts
    121
    OK I figured #1 out.. as long as I cleared the clipboard before I put anything on it, it works fine...thankyou

    #2 basically have you ever seen the hyperlinks were you click on them and they open up with your default mail program and the address and subject are filled in?

    well mailto:[email protected] does the address somehow you can include the subject etc.. in that link too.. don't rememvber how tho...

    thanks

  8. #8
    demirc
    Guest
    Code:
    "[email protected]?subject=ThisSubject"
    "[email protected]?body=Thisbody"
    I know this works with oe, outlook when using shell execute. Not sure about the rest. Also I wasn't able to get more than one tag working at a time (couldn't combine them) . MS says you need to use a, I think it was "|" to seperate the tags, not sure, can't remember !

  9. #9
    Frenzied Member Microbasic's Avatar
    Join Date
    Mar 2001
    Posts
    1,402
    Actually, you use the & sign. E-mails work just like CGI programs and PERL scripts, so:

    Code:
    Scriptlet1.URL = "mailto:[email protected]?subject=MicrobasicID2&body=Thisbody"
    would work fine. I don't know about the ShellExecute API, however...I think that's only supposed to run local programs. It's better to use the Scriptlet control, which is located in MSHTML.DLL <MS Internet Objects>.

    http://forums.vb-world.net/newreply.php&action=newreply&threadid=69846


    MicroBasic
    Dragon Shadow Trainer

    There is no good or evil in the world...only programmers and fools .

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Utah, USA
    Posts
    121

    Image FIle

    OK question #3:

    I have an image file in my app...just used the image control....well I tried it (the exe) on anouther machine and surprise, surprise it didn't show up! so..

    Where does it look for the image file? (is it just the current running directory?)

    And is there a way to incorporate the pic into the exe?

    thanks Zevlag

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Apr 2001
    Location
    Utah, USA
    Posts
    121

    Cursors

    ok.. one more. basically the same question what about cutom mouse icons /cursors?

    Zevlag

  12. #12
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Re: Image FIle

    Originally posted by Zevlag
    And is there a way to incorporate the pic into the exe?
    Search the posts for info on Resource files. These get compiled into your exe.

  13. #13
    Hyperactive Member Dasiths's Avatar
    Join Date
    Apr 2001
    Location
    Colombo, Sri Lanka
    Posts
    331

    OK

    launch the url "mailto:[email protected]?subject=yoursubject&body=body" with in the program ?

    Here is the code to launch the default mail program..

    ' Browser call routine
    #If Win32 Then
    Private Declare Function ShellExecute Lib _
    "shell32.dll" Alias "ShellExecuteA" _
    (ByVal hwnd As Long, _
    ByVal lpOperation As String, _
    ByVal lpFile As String, _
    ByVal lpParameters As String, _
    ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long
    #Else
    Private Declare Function ShellExecute Lib "shell.dll" (ByVal hwnd As Integer, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Integer) As Integer
    #End If
    Private Const SW_SHOWNORMAL = 1

    Private Sub Link1_Click()
    Dim iret As Long
    iret = ShellExecute(Me.hwnd, vbNullString, "mailto:[email protected]?subject=yoursubject&body=body", vbNullString, "c:\", SW_SHOWNORMAL)
    End Sub

    See form below ....
    Attached Files Attached Files
    It is the mark of an instructed mind to rest satisfied with the degree of precision which the nature of the subject admits, and not to seek exactness when only an approximation of the truth is possible.
    -Aristotle As quoted in Rapid Development, chapter 8, page 167.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width