标签: message

如何在C#中获取消息?

如何获取特定方法的特定消息?

我见过一些例子,人们使用"ref",但我不明白.

例如,在delphi中,我的函数(方法)必须在Main Form类中声明,并且在我必须放置消息的声明旁边

type
  TForm1 = class(TForm)
    ...
  protected
    procedure MessageHandler(var Msg:Tmessage);Message WM_WINSOCK_ASYNC_MSG;
end;
Run Code Online (Sandbox Code Playgroud)

我需要在C#中使用它,所以我可以在我的应用程序中使用WSAAsyncSelect

检查>我的其他问题<以赏金550的声望来理解我的意思

c# message winsock winforms

0
推荐指数
2
解决办法
5556
查看次数

Iphone SDK 4短信作曲家

有没有人试图使用SDK4的短信作曲家?如果有人有一些参考或源代码请放在这里

谢谢

iphone sms message objective-c

0
推荐指数
1
解决办法
2430
查看次数

Kohana 3:ORM验证消息

我正在尝试在Kohana 3(Orm Model)中添加验证消息.

类/模型/ cliente.php

<?php defined('SYSPATH') or die('No direct script access.');

class Model_Cliente extends ORM {
 protected $_table_name = 'clientes';
 protected $_primary_key = 'id';
 protected $_has_one = array('loja' => array());
 protected $_rules = array(
  'responsavel' => array('not_empty' => array(), 'min_length' => array(3)),
  'email' => array('not_empty' => array(), 'email' => array()),
  'telefone' => array('regex' => array('/^(\(\d{2}\)|\d{2})[ -]?\d{4}[ -]?\d{4}$/'))
 );
}
?>
Run Code Online (Sandbox Code Playgroud)

消息/ cliente.php

<?php defined('SYSPATH') or die('No direct script access.');

return array(
    'responsavel' => array(
        'not_empty' => 'O nome do …
Run Code Online (Sandbox Code Playgroud)

php validation message kohana-3 kohana-orm

0
推荐指数
1
解决办法
2223
查看次数

无限的Windows消息循环

我的程序中有这个消息循环:

while (true) {
    if (PeekMessage(&msg, window, 0, 0, PM_REMOVE)) {
        if (msg.message == WM_QUIT) {
            MessageBox(NULL, L"Quit", L"", 0);
            break;
        }
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    } else {
        Render();
    }
}
Run Code Online (Sandbox Code Playgroud)

这个循环永远不会结束 即使主窗口消失,它也不会显示消息框.这是WndProc代码:

switch (msg) {

    case WM_CLOSE :
        DestroyWindow(hwnd);
        break;

    case WM_DESTROY :
        PostQuitMessage(0);
        break;

    default :
        return DefWindowProc(hwnd, msg, wParam, lParam);
        break;
}

return 0;
Run Code Online (Sandbox Code Playgroud)

有人可以帮帮我吗?我真的把我的头发拉了出来.

c c++ windows winapi message

0
推荐指数
1
解决办法
2151
查看次数

Android按钮onClick显示AlertDialog应用程序崩溃

当我按下"提交"按钮时,我正在尝试显示AlertDialog.

Button submit = (Button) findViewById(R.id.submitButton);
            submit.setOnClickListener(new View.OnClickListener() {
                public void onClick(View view) {
                    AlertDialog.Builder builder = new AlertDialog.Builder(Application1GoodExample.this);
                    builder.setMessage("Your form has been successfully submitted");
                    TextView textView = (TextView) findViewById(android.R.id.message);
                    textView.setTextSize(40);
                    builder.setNegativeButton("Exit", new DialogInterface.OnClickListener() {
                          public void onClick(DialogInterface dialog, int which) {
                              dialog.cancel();           
                        } });

                    builder.show();

                }

            });
Run Code Online (Sandbox Code Playgroud)

我相信这与它试图访问有关 findViewById(android.R.id.message)

我在XML文件中定义了TextView,如下所示:

 <TextView android:id="@+id/message" 
        android:layout_width="285dp"
        android:layout_height="78dp" 
        android:textColor="#000000" 
        android:textSize="45sp" 
        android:gravity="center"
        />
Run Code Online (Sandbox Code Playgroud)

我只想更改默认的AlertDialog消息"您的表单已成功提交"字体大小,但是当我按下"提交"按钮时我的程序崩溃了

fonts alert android message dialog

0
推荐指数
1
解决办法
242
查看次数

如何识别 URL 中的 Enter 键?

我正在此URL 中创建一个 android 应用程序,它与用户定义的消息一起传递。

我的网址是:

获取消息的 URL

我的问题是:当用户按下空格时,空格可以通过Space="%20"来识别, 但是当用户按下回车键时该怎么办?

有什么方法可以识别用户在 URL 中按下了 Enter 键

谢谢你。

url android message space enter

0
推荐指数
1
解决办法
7740
查看次数

C#连接到SQL数据库错误

我是编程的新手.我有我的程序有问题,我所要做的是创建一个注册页面,以便用户可以注册,它会保存到SQL数据库,但我得到了一个错误,我不知道这意味着什么,我会全贴错误消息抱歉,如果它不具体.如果可能的话,请用简单的语言向我解释.


这是我的代码:

protected void registerBtn_Click(object sender, EventArgs e)
{
    String conString = @"Data Source=sql-server;Initial Catalog=wa310;Integrated Security=True";
    SqlConnection myConnection = new SqlConnection(conString);

    string cmd = "INSERT INTO Student( First_Name, Surname, User_ID, Password) VALUES ( '" + fNameTxt.Text + "' , '" + sNameTxt.Text + "','" + userIdTxt.Text + "' ,'" + passwordTxt.Text + "')";
    SqlCommand myCommand = new SqlCommand(cmd, myConnection);

    try
    {
      myCommand.Connection = myConnection;
        myConnection.Open();
        myCommand.ExecuteNonQuery();
        Label1.Text = "You have successfully registered";
    }
    catch (Exception ex)
    {
        Label1.Text = "Exception …
Run Code Online (Sandbox Code Playgroud)

c# sql-server asp.net message

0
推荐指数
1
解决办法
2万
查看次数

为什么我无法使用PeekMessage()创建成功的消息循环?

我的猜测它以某种方式接收WM_QUIT消息,因为这就是while循环所围绕的(根据proc函数在处理WM_DESTROY消息时发生)

每当我使用PeekMessage而不是GetMessage时,窗口会自动关闭,我使用PeekMessage以最大速度运行循环

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
if(!CreateMainWindow(hinstance, nCmdShow))
   return false;
//this works
while (GetMessage(&msg, (HWND) NULL, 0 , 0))
{
    TranslateMessage(&msg);
    DispatchMessage(&msg);
}
return (int) msg.wParam;
    UNREFERENCED_PARAMETER(lpCmdLine);
}    

//this automatically closes the window
int done = 0;
while (!done)
{
    if (PeekMessage (&msg, NULL, 0 ,0, PM_REMOVE))
    {

        if (msg.message = WM_QUIT)
            done = 1;
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
}
return msg.wParam;
    UNREFERENCED_PARAMETER(lpCmdLine);
Run Code Online (Sandbox Code Playgroud)

这是简单的WinProc功能

LRESULT CALLBACK WinProc ( HWND hWnd, UINT msg, …
Run Code Online (Sandbox Code Playgroud)

winapi message loops

0
推荐指数
1
解决办法
105
查看次数

如何更改警报对话框中按钮的颜色

这是我创建对话框的代码,

builder.setMessage(msg).setNeutralButton("Dismiss",dialogClickListener)
                       .setPositiveButton("Edit", dialogClickListener)
                       .setNegativeButton("Delete", dialogClickListener).show();
Run Code Online (Sandbox Code Playgroud)

是否可以用蓝色而不是红色显示解雇?

android message

0
推荐指数
1
解决办法
8490
查看次数

Laravel - 登录消息

我目前正在开发 Laravel 5.8 版本,我正在使用 Laravel make:auth 选项。这让我登录和注册,我所做的一切我添加了一个电话号码。所以这就是它在我的register.blade.php

@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">{{ __('Register') }}</div>

                <div class="card-body">
                    <form method="POST" action="{{ route('register') }}">
                        @csrf

                        <div class="form-group row">
                            <label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>

                            <div class="col-md-6">
                                <input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus>

                                @error('name')
                                    <span class="invalid-feedback" role="alert">
                                        <strong>{{ $message }}</strong>
                                    </span>
                                @enderror
                            </div>
                        </div>

                        <div class="form-group row">
                            <label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> …
Run Code Online (Sandbox Code Playgroud)

php authentication message laravel

0
推荐指数
1
解决办法
126
查看次数

git在拉后打开vim-发生了什么事?

每次我拉(git pull)时,git都会打开一条vim并显示以下消息: 在此处输入图片说明

git vim merge message

-1
推荐指数
1
解决办法
564
查看次数

如何制作if语句然后发送消息

我如何制作它,以便如果用户的输入是肯定的,那么发送消息你成功地追捕了一头牛!

System.out.println("Would you like to hunt a cow?");
System.out.print("yes or no?");
String a = kbReader.next();
System.out.println("You successfully hunted a cow!")
Run Code Online (Sandbox Code Playgroud)

java message if-statement

-6
推荐指数
1
解决办法
132
查看次数