Jump to content
Xtreme .Net Talk

Console

Members
  • Posts

    2
  • Joined

  • Last visited

Console's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. The quick and simple solution (without needing to use or test any conversion methods) would be: Dim simon As String = "true" Dim b As Boolean If simon = "true" Then b = True Else b = False End IfSimple may not always be the most sophisticated way of doing something, but it sure gets the job done :) (and did I mention language independent?)
  2. I would very much like an answer to this question. It looks as though it should work with a windows handle, however it seems to only work when I supply a control handle. Anyone able to provide a definitive answer to this? Thanks For reference, the code in question: Public Class Form1 Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer Private Declare Ansi Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer Private Const WM_CHAR = &H102 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim windowHandle As Integer = FindWindow(vbNullString, "Untitled - NotePad") '/// assuming you have notepad open. Dim controlHandle As Integer = FindWindowEx(windowHandle, 0, "Edit", vbNullString) SendMessage(windowHandle, WM_CHAR, Keys.B, 0) '<-- Doesn't work SendMessage(controlHandle, WM_CHAR, Keys.C, 0) '<-- Works End Sub End Class
×
×
  • Create New...